You are not logged in.

Announcement

Forum database was corrupt and an old backup was restored as temporary replacement. Registrations closed until the database is recovered. Please ask questions using the Contact form

#1 07-08-2014 10:59:36

hamza7t
Contributors
Registered: 05-08-2014
Posts: 12

Changing the Page title in pages.php

Hello,
I have alot of pages in the website, so i make folders(which contain the webpages, *.php) in the Pages folder, and when i did this the $pageTitles in pages.php is not working anymore .
how to fix this ?
( so i have pages->myFolder-> *.php  instead of pages-> *.php )
Thanks.

Offline

#2 07-08-2014 11:52:59

chrismaliszewski
Contributors
From: Torun, Poland
Registered: 06-05-2013
Posts: 246
Website

Re: Changing the Page title in pages.php

Not the best solution but it works.

  1. Make a copy of your whole page catalogue (just in case).

  2. Go to inc/essentials.php file and open it. Comment line set_include_path("../"); and add this code below this line:

    if(!isset($include_path))
    {
    	$include_path = "../";
    }
    set_include_path($include_path);
  3. In config/pages.php if you want to have page in subcatalogue write page name as path_to_file/file_name.php, i.e. act/activities.php - it means that file is in catalogue pages/act/.

  4. In every subpage (every PHP files in catalogue pages/ and its subcatalogues) create a variable called $include_path (the same name like in 1.) before set_include_path() function. Set it's value to as many "../" as it's required - normally it will be $include_path = ".."; (subpage in pages/ directiory), with one subcatalogue in pages/ it will be $include_path = "../../"; etc.. Than change code:

    set_include_path("../");

    to

    set_include_path($include_path);

  5. If you want to create a tile with url to page you do it like that:

    "url"=>"act/activities.php"

    which means it's url to file pages/act/activities.php.

  6. If you have menu on the top of subpage (example is here: About, Features, Demos), remember to change urls in $subNav variable to proper link, for example: act/activities.php.

Solution works for me but may require some more tests.
Cheers.

Last edited by chrismaliszewski (07-08-2014 14:12:05)

Offline

#3 07-08-2014 12:23:55

hamza7t
Contributors
Registered: 05-08-2014
Posts: 12

Re: Changing the Page title in pages.php

Thanks for the help, bu i have some problems
I did what you said but in step 4 , i dont have set_include_path() function in my subpages but i added what you said .( i dont think if this is the problem now)
and where i find $subNav ? i dont have it in pages.php



this is my pages.php without the comments.

[== PHP ==]

	
$pageTitles['Admin/user-management.php'] = "User Management";

$pageURL['Admin/user-management.php'] = "Management";

Last edited by hamza7t (07-08-2014 12:26:15)

Offline

#4 07-08-2014 12:59:43

chrismaliszewski
Contributors
From: Torun, Poland
Registered: 06-05-2013
Posts: 246
Website

Re: Changing the Page title in pages.php

You missunderstood me. By saying "subpage" and whole point 4 I meant changes in every file in catalogue pages/ - which are pages in whole website -> page, so I usually call them subpages. Only point 3 is about changes in config/pages.php. I'll edit post above to make it clear.

Last edited by chrismaliszewski (07-08-2014 13:00:12)

Offline

#5 07-08-2014 14:03:31

hamza7t
Contributors
Registered: 05-08-2014
Posts: 12

Re: Changing the Page title in pages.php

yes i did that on every PHP page in pages folders and subfolders, but i still dont know what u mean by $subNav

Offline

#6 07-08-2014 14:09:51

chrismaliszewski
Contributors
From: Torun, Poland
Registered: 06-05-2013
Posts: 246
Website

Re: Changing the Page title in pages.php

Sub nav is array variable which stores menu on the top on subpage. Example of this kind of menu is here: About, Features, Demos. If you don't have $subNave variable (you don't have menu on the top of page), don't bother with point 6.

Offline

#7 10-08-2014 07:13:37

hamza7t
Contributors
Registered: 05-08-2014
Posts: 12

Re: Changing the Page title in pages.php

Nop, Im working on linking my pages to another site now and will test it again later

Offline

Board footer

Powered by FluxBB