| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Simple CMS module and custom page code | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Simple CMS module and custom page code
Wishing to use Nanogallery to add a flickr gallery to a Page created via the Simple CMS module in xcart 5, however unlike the static page creator functionality in xcart-4, this new module eats all the code ( link, script, style) tags I want to paste into the page in addition to the text-based content above the gallery images.
How do I ensure that if I am to go ahead and create a module to add this code to the system, that the resulting markup (all the css, html, script, link tags in header, etc) are only loaded for the one static page, and nowhere else (to cut down on page load times for the rest of the site) ?
__________________
-- Scott Godin |
|||||||||
#2
|
|||||||||
|
|||||||||
Re: Custom css and js on a Page created with Simple CMS
http://kb.x-cart.com/display/XDD/Adding+pages+to+your+store is all well and good, but nowhere do I find a tutorial on how to add customized css and js that runs specifically and only on ONE custom page created via Simple CMS
I've been looking high and low for this information and so far have turned up absolutely nothing. I am having a hard time believing no one has ever wanted to do this, so the dearth of info is quite surprising.
__________________
-- Scott Godin |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: Simple CMS module and custom page code
http://kb.x-cart.com/display/XDD/Adding+CSS+and+JS+files
This will give you an answer in general. If you want to add css to a specific page within the module you should have a condition for the page identifier
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#4
|
|||||||||
|
|||||||||
Re: Simple CMS module and custom page code
Quote:
As a quick workaround solution, try to modify etc/config.php file and add the following line of code: HTML.Trusted = On right after this line: [html_purifier]
__________________
Sincerely yours, Sergey Fomin X-Cart team Chief support group engineer === Check this out. Totally revamped X-Cart hosting http://www.x-cart.com/hosting.html Follow us: https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart |
|||||||||
#5
|
|||||||||
|
|||||||||
Re: Simple CMS module and custom page code
Quote:
How does one implement a 'condition for the page identifier' or identify the page specifically when it is one generated by Simple CMS ?
__________________
-- Scott Godin |
|||||||||
#6
|
|||||||||
|
|||||||||
Re: Simple CMS module and custom page code
Every page has an id attribute. You can use it to load specific css file
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#7
|
|||||||||
|
|||||||||
Re: Simple CMS module and custom page code
Quote:
In my case, the page id I wish to affect appears to have an ID of 3, from the url (though it states that nowhere else on the admin page itself for editing that page's content) However neither http://kb.x-cart.com/display/XDD/Adding+CSS+and+JS+files, nor http://kb.x-cart.com/display/XDD/Adding+custom+JavaScript+code+to+the+page indicate how one specificially targets a page ID with css and js for that page exclusively, nor is mention made at http://www.x-cart.com/extensions/addons/simple-cms.html of anything related to this. Since you clearly already know how to do this, please share with us in detail, so we can have it added to the wiki, and save time for everyone in the future.
__________________
-- Scott Godin |
|||||||||
#8
|
|||||||||
|
|||||||||
Re: Simple CMS module and custom page code
You can do this in your module when extending pages viewer class to use specific css on specific page
PHP Code:
In more complicated and ideal example you may want to do an actual search through all pages to find the id you are looking for based on page name (which is something you are more likely to know that the id) PHP Code:
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#9
|
|||||||||
|
|||||||||
Re: Simple CMS module and custom page code
aha, yes that definitely should be in the Wiki, in the Add CSS and JS files page, and thanks also for the further example, this should be very helpful. I'll go give this a shot and see what's what after that. Cheers!
__________________
-- Scott Godin |
|||||||||
#10
|
|||||||||
|
|||||||||
Re: Simple CMS module and custom page code
for reference for anyone else following this at a later date, $cnd information can be found here, for starters: http://kb.x-cart.com/display/XDD/search%28%29+method
__________________
-- Scott Godin |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|