ConLib Not Showing Up

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.
Post Reply
euroluxantiques
Commander (CMDR)
Commander (CMDR)
Posts: 118
Joined: Sat Dec 20, 2008 11:27 pm

ConLib Not Showing Up

Post by euroluxantiques » Fri Feb 11, 2011 8:45 am

I'm redesigning my store header in 7.0.6 and I wanted to add SimpleSearch to the header. I used [[ConLib:SimpleSearch]] and when I refresh the page in the browser, I literally get [[ConLib:SimpleSearch]], rather than the search box. I've tried other ConLib to see if it was a problem with SimpleSearch itself or if it was ConLib in the header in general. It seems I get the same basic result for all ConLib--just the "[[ConLib:xxx]]" showing up in my design. Anyone seen this before?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: ConLib Not Showing Up

Post by mazhar » Mon Feb 14, 2011 4:32 am

Not sure, may be for some reason you made it HTML encoded? Are you trying to use design mode of FCK editor. Give a try edit the scriptlet don't open design mode and then in code add following piece.

Code: Select all

[[ConLib:SimpleSearch]]

euroluxantiques
Commander (CMDR)
Commander (CMDR)
Posts: 118
Joined: Sat Dec 20, 2008 11:27 pm

Re: ConLib Not Showing Up

Post by euroluxantiques » Mon Feb 14, 2011 8:43 am

I think that's the problem. Here's what I was trying to do:

My site has many different headers, with different background images, so I need to be able to change those backgrounds using CSS. To do this, I have set up different scriptlet headers, e.g., StandardHeader, ProductHeader, SearchHeader. The only difference between these scriptlets is the id of one of the div tags in the header so that I can reference the specific header in CSS to apply the different background image. Rather than coding the navigation links directly into each header, I wanted to set up another scriptlet to hold those links. This would be helpful if I need to change the navigation links. I could change them in the 1 scriptlet, rather than having to do it for all headers separately.

However, I cannot seem to include one scriptlet in another scriptlet by reference. As an alternative, I set up a new custom ConLib called Header.ascx, which then references the HeaderLinks scriptlet via an include statement, i.e.,

<!--#include file="../../../App_Data/Scriptlets/Custom/Header/HeaderLinks.htm"-->

This works for getting those links into all headers, but when I want to include [[ConLib:SimpleSearch]] into the scriptlet HeaderLinks.htm, it renders that reference as HTML, rather than loading the include. Do you know how to get around this? Is there a way to reference a scriptlet within a scriptlet without using an include statement through a ConLib?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: ConLib Not Showing Up

Post by mazhar » Tue Feb 15, 2011 7:05 am

Well its pretty complicated. Better you should just drop your styles sheets under current store theme folder and it will automatically make them available across retail website. You don't need manually include them in headers.

euroluxantiques
Commander (CMDR)
Commander (CMDR)
Posts: 118
Joined: Sat Dec 20, 2008 11:27 pm

Re: ConLib Not Showing Up

Post by euroluxantiques » Tue Feb 15, 2011 9:33 am

Thanks, but that's not really the issue. I have a custom theme set up with a custom style sheet in that theme. Each type of our store pages have different background images in the headers. The only way to assign different background images for different pages is to set up different id attributes in the header itself. To do this, the only way I could think of is to create a separate scriptlet for each header I needed. However, each header shares common information like the navigation links, and it seems to be more friendly from a maintenance point of view to reference this common information from another scriptlet.

I couldn't find any way around it, so I decided that I would just write a ConLib with the custom header links and reference that as [[ConLib:xx]] as normal. This keeps me from having to reference a scriptlet within a scriptlet, but I do think that might be a good feature for AbleCommerce to allow in the future. AbleCommerce gives the UI to create custom scriptlets, so less-advanced users can handle that. Creating a custom ConLib is a little more advanced, and there's no UI for that and oftentimes (as in this case) where a user just wants to create reusable HTML, a scriptlet makes a little more sense. However, you apparently lose the ability to reference a ConLib because the 2nd-referenced scriptlet encodes as only HTML.

Post Reply