Page 1 of 1

List pages as a dropdown

Posted: Wed Oct 18, 2017 5:26 pm
by wungaz

Is it possible to list my current custom files as a dropdown or all the pages that are in my project.


Re: List pages as a dropdown

Posted: Thu Oct 19, 2017 9:12 am
by mobhar

As a Developer, you should be able to list all your Custom Files each time you add/remove it from your project. Just write your code for that as usual.


Re: List pages as a dropdown

Posted: Thu Oct 19, 2017 11:27 am
by arbei

What do you mean "list my current custom files as a dropdown"?

Make the menu item as a drop down list?


Re: List pages as a dropdown

Posted: Thu Oct 19, 2017 1:23 pm
by kirondedshem

if you mean you are in a situation where.

  1. you have a bunch of custom files which do a similar activity but each does it a little different, forexample they all print a report but each does it differently.(they dont have to be doing similar activities they can even be unrelated)
  2. you want to give users an form where they select a prefered action, but since each of those actions is related to a custom file, you would prefer to list the custom file as drop down entries.

If ythe form the users are using to select the desired action is a phpmaker add,edit form.
Then ensure you have a field or create a custom field to assign drop down controll on.The datatype should be a varchar
Go to field settings and set view tag as select.
In the right side corner of "user values", click on the plus sign to add a new drop down item.
enter the value as one of your custom files name eg "custom_file_1.php".
Then enter Label as something secriptive eg "Report 1"
Repeat that for all desired custom files you want to show.

Now you have drop down where user does not even need to know the rul of the file but when they select it wll save the url of the file and you can do whatever you want or even redirect to that url after inserting or updating a record.

Even if its a custom drop down in a custom file, you can still use the same approach exept you draw the select controll manually


Re: List pages as a dropdown

Posted: Fri Oct 20, 2017 3:20 am
by wungaz

I have a table Page_Content which will store the content for the Custom files instead of manually editing them. Now i want to link the content with Custom Files. I want to be able to have a list of my custom files like the way they are list on the User Permissions on userpriv.php. This way i will be able to edit the Page_Content table without editing custom files and allow anyone to modify the website without manually changing custom files.


Re: List pages as a dropdown

Posted: Fri Oct 20, 2017 10:21 am
by arbei

Just generate the table "Page_Content" as a normal table is fine, so everyone can edit the page content of the custom files.

To display different content from the "Page_Content" table to the custom file, you can use URL parameters and handle it with your code in the content of the custom file and use the DbHelper() or ew_Execute() to retrieve the corresponding data from the table.


Re: List pages as a dropdown

Posted: Fri Oct 20, 2017 6:09 pm
by wungaz

I have created a Page_Content and on the menu table i manually add the page name like mypage.php and use ew_CurrentPage to get the current page name on custom files. Now using the DB helper to query the menu table and page content. To make changes i only modify pages on the Page_Content Table. Works perfect now as a great CMS.