![]() |
Get template filename from pageid
Hello everyone!
I need some help to identify the best way to get a template's "filename" related to a static page "pageid". The problem began when I started adding/deleting static pages, the Ids broke their relations with filenames, probably because MySQL has an autonumber giving the Ids and not resetting them to zero... So, instead of having a direct relation (pageid=1 => page_001.html, pageid=2 => page_002.html) I have ended with non-related pairs (pageid=5 => page_001.html), making it difficult to identify the correct "filename" for a given "pageid". This can be done iterating through the "$pages_menu" array, searching for the correct key and get out the filename when found - the following piece of code is working good, but I would like some opinions on how to improve it or if there is a better way. Code:
{assign var="pagefile" value=""}Thank you! Raul Carvalho |
wouldnt it be better to give your pages a more descriptive name in the first place ?
|
Descriptive names
Hello Shan!
Quote:
Do you mean "betterpagename.html" instead of "page_001.html"? This is not the issue, since having more descriptive names still don't help me find the filename from the pageid... Anyway, the described method above works but I feel it should be simpler... Thanks! |
| All times are GMT -8. The time now is 01:43 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.