| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Get template filename from pageid | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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:
Thank you! Raul Carvalho |
|||||||
#2
|
|||||||||
|
|||||||||
wouldnt it be better to give your pages a more descriptive name in the first place ?
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. EWD Hosting Hands On Hosting |
|||||||||
#3
|
|||||||
|
|||||||
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!
__________________
Raul Carvalho |
|||||||
|
|||
X-Cart forums © 2001-2020
|