![]() |
The template names in the source code
1 Attachment(s)
Disclaimer: This mod is provided on an "as-is" basis without warranty of any kind. Feel free to use and improve it, but please do not sell it.
Description: This mod is for those X-Cart masters who are not familiar with the templates structure yet. Install this mod, refresh any dynamic X-Cart page and check the HTML source. You'll see that X-Cart prints the templates names where the '{include}' Smarty tags are used. So you'll be able to find the required template easily, just check the source and find the template name near the necessary HTML code. How to install: 0. This mod was created for X-Cart 4.1.7. If you use other X-Cart versions, you may need to alter the code. 1. Edit the '<xcart_dir>/include/func/func.core.php' file and add the following code before the last '>?' line: PHP Code:
2. Edit the '<xcart_dir>/Smarty-2.6.12/Smarty.class.php' file, replace: PHP Code:
with PHP Code:
then replace: PHP Code:
with PHP Code:
3. Again edit the '<xcart_dir>/Smarty-2.6.12/Smarty.class.php' file, replace: PHP Code:
with PHP Code:
and replace: PHP Code:
with PHP Code:
|
Re: The template names in the source code
I wish I had this mod a year ago...
Thanks anyway! :D |
Re: The template names in the source code
:-)
very cool. this should be stock... HOWEVER, there should be a "disable" switch so a visitor can't see or try to exploit this info. I don't need visitors knowing paths and template names. BUT - this is a great idea for newbies and stores in development. Thanks for posting this! |
Re: The template names in the source code
Quote:
Use the following code: PHP Code:
X-Cart will show the template names only for the URLs like 'home.php?cat=111&show_template_names=Y', i.e. with 'show_template_names' parameter. |
Re: The template names in the source code
Eugene,
Thanks... that's great, but for those of us with cdseo, this will not work, since our URLS look like, "domain.com/category/product.html But thank you for the idea... |
Re: The template names in the source code
Quote:
The 'func_show_as_comment()' function can check that administrator is logged in, so X-Cart will show the template names in such cases only. (i.e. you log in as administrator and open the customer area) If you need this code, I can create it : ) |
Re: The template names in the source code
Quote:
Well that's a grea idea! So only a logged in admin (on the customer side) will see the code? Now that's brilliant. Is there a performance hit asociated with this? Thanks for contributing this! |
Re: The template names in the source code
Quote:
No. Quote:
Use this code: PHP Code:
: ) |
Re: The template names in the source code
Eugene,
I found a slight problem with this new mod: In Windows IE6 and IE7, WHILE LOGGED IN as admin, it disrupts the css style sheet, to the point where a "centered" container no longer centers, category menus distort and basically the site looks like doo. A simple logout by the admin and everything is back to normal. if the admin logs in, then it looks like doo again (that is, CSS is not recognized or used). This problem does not show itself in Firefox (win or mac) or any mac browser. I did not test in Safari/windows. Basically, whatever is going on here disrupts the CSS code in MSIE 6 and 7 (win XP pro SP2 -- tested on 2 different machines) - ONLY when logged in as admin. For now, I have reverted to what I had, and I can re-visit this another time... Thanks Jeremy |
Re: The template names in the source code
Quote:
I've checked this mod on the default X-Cart installation and haven't found any errors. Do you use any custom templates? If yes, you need to add their names to the '$templates' array, so the 'func_show_as_comment' function will not process them. |
Re: The template names in the source code
Thanks a lot!
Just what i needed! |
Re: The template names in the source code
add:
"customer/home.tpl", to the $templates in function func_show_as_comment Code:
function func_show_as_comment($string, $end=false) { Quote:
|
Re: The template names in the source code
1 Attachment(s)
I am just starting designing my x-cart store. This mod is extremely helpful in figuring all this out.
I have discovered that this mod "breaks" the mod for "Color Code Order Status". http://forum.x-cart.com/showthread.php?t=4949&highlight=color+orders The modifications to Smarty cause problems in the color coding of the Order Status table. Any suggestion on how I can make both work. This is WAY over my head. Thanks, David http://forum.x-cart.com/images/attach/jpg.gif |
Re: The template names in the source code
I tried to put this in my 4.1.11 shop, but all i got at the customer fornt was an empty page.
Some i do wrong? |
All times are GMT -8. The time now is 12:08 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.