I know this kind of defeats the purpose of using the Content Management and Flex items, but if I want to only show the Quick Order Form to logged in customers, is the best way to simply add the item to a page manually say in the footer and write the condition there to display it or is there a better way?
Announcement
Collapse
No announcement yet.
Quick Order Form Item Conditional
Collapse
X
-
You can wrap the flex component output in a conditional, but it would impact all flex components on the page not just a single component. So someone who was not logged in would see a blank page or a message asking them to login.
But here is an example of the template code you would need. First create the page you want then edit the template and wrap the flex component output (called a sequence) in a conditional
<mvt:if expr="g.basket:cust_id NE 0">
<mvt:item name="sequence" />
<mvt:else>
You must be logged in to view this page
</mvt:if>
Another option would be to do a similar conditional and have it automatically redirect to the login screen if they are not logged in.
- 1 like
-
You could also use theCode:<mvt:item name="header_sequence" />
Code:<mvt:item name="footer_sequence" />
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
- 1 like
Comment
-
Originally posted by lesliekirk View PostYou could also use theCode:<mvt:item name="header_sequence" />
Code:<mvt:item name="footer_sequence" />
Highly caffeinated
http://www.coffeehouseexpress.com
Comment
-
You could also create your own sequence item by selecting the add item button from the items tab on any page. Then choose the cmp-mv-sequence module and give the item a code of your choice. Now you can assign this new item to any page and add <mvt:item name="sequence" /> to the template where you want it to display.
If you want to give the sequence item a specific name you can import this XML into data management and it will give the item a custom name:
Code:<Page_Update code="ABUS"> <Item code="footer_sequence"> <Title>Page Builder Footer</Title> </Item> </Page_Update>
Nicholas Adkins
Technical Training Specialist / Miva, Inc.
[email protected]
https://www.miva.com/mivalearn
- 1 like
Comment
-
Originally posted by Nick View PostYou could also create your own sequence item by selecting the add item button from the items tab on any page. Then choose the cmp-mv-sequence module and give the item a code of your choice. Now you can assign this new item to any page and add <mvt:item name="sequence" /> to the template where you want it to display.
If you want to give the sequence item a specific name you can import this XML into data management and it will give the item a custom name:
Code:<Page_Update code="ABUS"> <Item code="footer_sequence"> <Title>Page Builder Footer</Title> </Item> </Page_Update>
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
- 1 like
Comment
-
Are these items appropriate to use?
Code:<mvt:item name="flex" param="mmx_imageandtext" /> <mvt:item name="flex" param="mmx_quickorder" />
Highly caffeinated
http://www.coffeehouseexpress.com
Comment
-
Originally posted by Jim Cockerham View PostAre these items appropriate to use?
Code:<mvt:item name="flex" param="mmx_imageandtext" /> <mvt:item name="flex" param="mmx_quickorder" />
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr
Comment
-
Originally posted by lesliekirk View Post
Are you wanting to try and use the component outside of the PageBuilder "framework"?Highly caffeinated
http://www.coffeehouseexpress.com
Comment
-
Jim Edwards the best resource to understand Miva's Flex Components is this page: https://docs.miva.com/miva10/referen...flex-component
There is a bit of information in there around the Sequence item but essentially when it is added to a template (and assigned) it will render the flex components that have been added via page builder.
You can have multiple sequence items on the page with flex components added via page builder. If there are multiple sequence items assigned to the page the item names will show up in PageBuilder in a dropdown right above the add component section.
Although the way you implemented the functionality works it is not the way it was intended to be used. My suggestion would be to write a condition to redirect the user if they are not intended to view the page, https://docs.miva.com/code-samples/m...t-to-canonical. If that is too much then you could also simply write a condition around the <mvt:item name="sequence"> tag and that will hide the sequence that the quick order flex component is added.Nicholas Adkins
Technical Training Specialist / Miva, Inc.
[email protected]
https://www.miva.com/mivalearn
- 1 like
Comment
-
Thanks to everyone for the help with this. This was my first look at using Page Builder on my existing site and I was making this much harder than it needed to be. Brennan's Solution is really all I needed in this case. For anyone who reads this post later, this "How to" article is helpful too: https://docs.miva.com/miva10/referen...der-storefrontHighly caffeinated
http://www.coffeehouseexpress.com
Comment
Comment