Code Generator > List Page: see only the records created by the user

14 posts by 3 authors in: Forums > CMS Builder
Last Post: June 24, 2023   (RSS)

By Dave - June 20, 2023

Hi Andreas, 

Are you referring the the list of records in the CMS itself? Or the list of records you see when you create viewer code and are viewing that PHP file through the browser? 

Let me know and I'll try to help, thanks!

Dave Edis - Senior Developer
interactivetools.com

By andreasml - June 21, 2023

Hi Dave

Thank you for your interest. 

I refer to the list of records created with the PHP viewer code. When I open the file, I see a list of the total number of records of the section. I would like to add some PHP code in the beginning to make some filtering of the returned results.

I hope it makes sense. If it does not, I can provide you with the code or some username/password to log in to this page (it is not free; one needs to log in through the Website Membership plugin to have access to this page). 

Kind regards, 

Andreas

By Dave - June 22, 2023

Hi Andreas, 

Ok, when the generate the view code you can either check the "Allow Searching" checkbox, or manually set that option to true in the generate code as follows:

'allowSearch' => true,

You can create a special link that only lists specific records. Just add a ("?") after your url, following by the search conditions (fieldname=value).
Example: listViewer.php?color=blue

Multiple search conditions can be combined with ("&").
Example: listViewer.php?color=blue&size=XXL

Those search for exact matches, but if you add _keyword to the end it will check for the search term anywhere in the content:
Example: listViewer.php?title_keyword=ai

You can create search forms by naming the fields after what you want them to search. Here is a simple search form that searches the "title" field for a keyword.

<form method="POST" action="?">
<input type="text" name="title_keyword" value="">
<input type="submit" name="submit" value="Search">
</form>

 I'd recommend experimenting with modifying the URL and creating forms and refer to our search documentation here: 
https://www.interactivetools.com/docs/cmsbuilder/viewer_search.php

Hope that helps! Let me know any other questions.

Dave Edis - Senior Developer
interactivetools.com