NVelocity Syntax in Webpages

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
User avatar
mikek
Commander (CMDR)
Commander (CMDR)
Posts: 112
Joined: Wed Oct 15, 2008 9:30 pm
Location: Boston, MA
Contact:

NVelocity Syntax in Webpages

Post by mikek » Tue Feb 19, 2013 1:11 pm

In AC 7 it was possible to include NVelocity syntax in custom web pages and all custom web page content was stored under App_Data\Scriptlets folders. It seems that AC Gold
NVelocity syntax like #if/#else/#end can not be included directly in webpage content. Referencing custom controls like [[ConLib:ControlName]] works, but not #if/#else/#end statements.

Where is the custom content stored in AC Gold? In AC 7.x all custom content is under App_Data\Scriptlets.
Mike Kolev

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

Re: NVelocity Syntax in Webpages

Post by mazhar » Wed Feb 20, 2013 2:50 am

You are right NVelocity will not work in pages any more. NVelocity was very helpful for quick checks within view but what we saw people started to use it like programming language alternative in AC7. NVelocity involves extra processing resulting the slow pages. In gold we decided to take away the NVelocity support from ablecommerce pages in order to make things simple and improve the page performance. Though there is an option to enable nvelocity rendering for dynamic pages like product, category or content pages making use of HtmlContainer control but we don't recommend it and you would be on your own if any thing doesn't work.

Now regarding scriptlets they are also removed from Gold. In past we found that scriptlets over complicated the page creation in AbleCommerce. It was quite hard to figure out what is being applied on a AC 7 page. In Gold we abandoned the scriptlets and moved to simple Master + Content page scheme. ASP.NET allows you to change master page on fly hence we created Layouts using master pages where we can apply different layouts on content pages dynamically without the need to change code. Now if you want to add new page you can simply create a new content page under Administration -> Webiste -> Webpages and all contents will go to database table ac_Webpages. These dynamic webpages do have the support to render ConLib controls as you already mentioned in your post so in Gold its kind of easy and simple to mange/create new pages. Alternativly you can add a physical page yourself which will only need you to extend if from suitable master page and thats it, no more pointers to different scriptlets under app_data simply add page and drag/drop the conlib controls.

User avatar
mikek
Commander (CMDR)
Commander (CMDR)
Posts: 112
Joined: Wed Oct 15, 2008 9:30 pm
Location: Boston, MA
Contact:

Re: NVelocity Syntax in Webpages

Post by mikek » Wed Feb 20, 2013 11:15 am

Thanks Mazhar,

Yes, not allowing NVelociry syntax in content pages totally makes sense. Thank you for the detailed explanation of my questions.
Mike Kolev

pjs75
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Thu Jul 14, 2011 9:10 pm

Re: NVelocity Syntax in Webpages

Post by pjs75 » Sun Apr 07, 2013 9:03 pm

What about dynamic menus - nvelocity allowed use to do that. Now I'm not sure how..?

Pat.

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

Re: NVelocity Syntax in Webpages

Post by mazhar » Mon Apr 08, 2013 2:24 am

You can implement the menu to be a conlib control and then you can use the ConLib in pages where you want to show the menu.

pjs75
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Thu Jul 14, 2011 9:10 pm

Re: NVelocity Syntax in Webpages

Post by pjs75 » Mon Apr 08, 2013 7:09 am

mazhar wrote:You can implement the menu to be a conlib control and then you can use the ConLib in pages where you want to show the menu.
I'm talking about fine grain control of menus based on roles of users - what you've proposed is not solution unless I'm missing something.

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: NVelocity Syntax in Webpages

Post by ForumsAdmin » Mon Apr 08, 2013 9:24 am

I don't think having or not having NVelocity syntax available will have any bearing on how a menu based on user roles is implemented. NVelcoity did not offer anything special as far as user roles are concerned.

If you want to implement role based menus, checkout how admin menu is implemented.
Admin/ConLib/AdminMenu.aspx
App_Data/adminmenu.xml

pjs75
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Thu Jul 14, 2011 9:10 pm

Re: NVelocity Syntax in Webpages

Post by pjs75 » Mon Apr 08, 2013 4:56 pm

Hi ForumsAdmin,
thanks for the feedback I'll look into these.

Regards,

Patrick.

Post Reply