Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
-
lastrom
- Ensign (ENS)
- Posts: 13
- Joined: Fri Jul 31, 2009 7:46 am
Post
by lastrom » Wed Feb 29, 2012 4:09 pm
I'm currently building a home page that uses a lot of jQuery, but also needs to have the majority of the content editable. Is it possible to have one scriptlet (the Home Page.htm in this case) to pull several other scriptlets?
Here's a simplified example of what I'm trying to accomplish:
Code: Select all
<div class="banners">
<div>
Scriptlet 1
</div>
<div>
Scriptlet 2
</div>
<div>
Scriptlet 3
</div>
</div>
<div class="call-to-action">
Scriptlet 4
</div>
This would allow my client the ability to update content dynamically (using scriptlets), but without ruining the very specific layout needed to make the jQuery plugins work. Is this possible with the base AbleCommerce (using a control/nVelocity/etc) or do I have to build something that does this? Any ideas?
Thanks!
-
david-ebt
- Captain (CAPT)
- Posts: 253
- Joined: Fri Dec 31, 2010 10:12 am
Post
by david-ebt » Wed Feb 29, 2012 4:48 pm
You could put your JavaScript and HTML into custom ConLib controls. Your customer could edit the HTML content but wouldn't be able to mess with your ConLib content.
The result would be something like this:
Code: Select all
<div class="banners">
<div>
[[ConLib:Custom\Script1]]
</div>
<div>
[[ConLib:Custom\Script2]]
</div>
<div>
[[ConLib:Custom\Script3]]
</div>
</div>
<div class="call-to-action">
[[ConLib:Custom\Script4]]
</div>
-
lastrom
- Ensign (ENS)
- Posts: 13
- Joined: Fri Jul 31, 2009 7:46 am
Post
by lastrom » Thu Mar 01, 2012 10:57 am
Is there any other way to do it? Doing it that way would mean I would need to make a lot of controls in order to get the functionality right.
-
jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
-
Contact:
Post
by jmestep » Fri Mar 02, 2012 7:20 am
You could use the same scriplet, only pass a variable/parameter to it. For example, see Able's category conlibs.
<param name="DefaultCaption" default="Catalog">Caption text that will be shown as caption when root category will be browsed.</param>
<param name="DisplayBreadCrumbs" default="true">Indicates wheather the breadcrumbs should be displayed or not, default value is true.</param>
<param name="PagingLinksLocation" default="BOTTOM">Indicates where the paging links will be displayd, possible values are "TOP", "BOTTOM" and "TOPANDBOTTOM".</param>
<param name="MaximumSummaryLength" default="250">Maximum characters to display for summary.</param>
-
lastrom
- Ensign (ENS)
- Posts: 13
- Joined: Fri Jul 31, 2009 7:46 am
Post
by lastrom » Fri Mar 02, 2012 11:26 am
Is there a control that already does this that comes with Able or will I have to basically write one?
-
lastrom
- Ensign (ENS)
- Posts: 13
- Joined: Fri Jul 31, 2009 7:46 am
Post
by lastrom » Fri Mar 02, 2012 11:41 am
Nevermind. I made a control that pulls the cb:ScriptletPart control and dynamically sets the content scriptlet based upon a property. Thanks for helping me get where I needed to be!