Poplets using {module_data}

I'm trying to insert poplets directly into my great layout using div tags, instead of the default table output. I followed the instructions on this page.

So far, I have the following. It does not work, but if a product has no poplets, it tries to display the code again and comes with an image with an empty attribute "src". Is not sure what to try next. Any help would be much appreciated

{module_data version = 'v3' resource = "products" resourceid = '{{id}}' fields = "poplets" collection model = "md_poplets" =""}

{% If md_poplets.poplets-%}

{% assign ppl = md_poplets.poplets | divided:-% ';'}

< div class = "poplets" >

< div id = "productPoplets" >

{% for article on ppl-%}

< div class = "small-2 columns left productPopletsItem" >

"< an onclick =" "rel =" "href ="{{point}}"title =" ">

< img id = "{{forloop.index}} catpproduct_" src = "{{point}}? Action = miniature & amp; width = 65 & amp; height = 65 & amp; USM = 1 "alt ="{{name}}"style =" cursor: point; "/ >

< /a >

< / div >

{% endfor}

< / div >

< div class = "clear" > < / div >

< / div >

{endif %}

Thanks for the link. I read the two articles on JSON in the developer documentation.

I tried your suggestion to put in my product, great layout, as follows:

{% If this.poplets-%}

{poplet % this.poplets %}

{% endfor}

{endif %}

For most of my products, this works perfectly. However, every now and then I find a product where the poplets do not appear, and the json is in the console as AND rendered on the page. I do not understand why this is happening for some products and not others. Any ideas?

* Edit - I think he had a conflict with another script on the pages where the code above does not work. Seems to work fine, now! **

Tags: Business Catalyst

Similar Questions

  • Using {module_data}: is it possible to get all the customers who are subscribers to 2 specific secure areas

    Using {module_data}: is it possible to get all the customers who are subscribers to 2 specific secure areas?

    That is to say: the list of all customers who subscribe to the secure area 51 and 6387 id.

    I am trying the configuration that you can see in the link below but is not working - I think that each customer is listed separately for each secure area, rather than listing a single customer and subscribed them to safe areas.

    2015-10-02_16-01 - 54.png - Google Drive

    I want to all clients in the CRM that match the criteria, not just check if the user matches the list.

    I can get it working for a secure or using GOLD, but the operator AND does not work in this case.

    Any thoughts?

    Do I have to run two separate (one for each secure area) calls, then compare the two somehow? Keeping in mind the 500 limit because it will look at the whole CRM.

    Hi Adam,.

    and do not work, as the system is testing to see if there is an object with two identity documents at the same time.

    What you can do, is useas follows:

    {module_data resource = "zonecustomers" version = "v3" fields = "customerId, IDZone" skip "0" limit = "100" = where = "\ {"IDZone": \ {"$dans": \ [51, 6387\] \} \}" order = 'zone ID' collection = "twoSZ" "}

    Yes, this will get duplicated in the result. Simply add the ID to a string, split to table and sort. Just made this to get unique products of 2 catalogs converted for your use case.

    EDIT (added a quick feature to find all of your customers)

    {module_data resource = "zonecustomers" version = "v3" fields = "customerId" skip = '0' limit = '1' where = "\ {"IDZone": \ {"$dans": \ [6524, 6664\] \} \}" order = 'zone ID' collection = 'howMany' "}

    {assign % max = howMany.totalItemsCount-%}

    Total customers: {{max}}

    {% assign limit = 500 - percent}

    {% assign moduloCheck = max: modulo: limit %}}

    {% If moduloCheck == 0 %}

    {% assign totalPages = max | divided_by: limit %}}

    {% other %}

    {% assign totalPages = max | divided_by: limit: more: 1 %}}

    {% endif %}

    Total pages: {{totalPages}}

    {% assign string = ' '-%}

    {% for i % (0.totalPages)}

    {module_data resource = "zonecustomers" version = "v3" fields = "customerId" skip = "{{limit |}}"} "{{time: I}}" limit = "{{limit}}" where = "------{'IDZone':------{'$dans':------[6524, 6664\]------}-}" order = 'zone ID' collection = "twoSZ"} "

    {% for article on twoSZ.items-%}

    {capture string %} {{item.customerId}},{{string}}{% endcapture-%}

    {% endfor}

    {% endfor}

    {% assign array string = | split: ',' |} Tri-%}

    {% assign UniqueId = ""-%}

    ID sorted

    {{ array | json }}

    {% assign index = 0-%}

    {% for a table-%}

    {% If index ==-%}

    {capture UniqueId %} {{a}}, {{uniqueIds}} {endcapture %}

    {endif %}

    {% index assign = a %-}

    {% endfor}

    Your customers

    {{ uniqueIds | split: "," | sort | json }}

    I had over 1000 clients. For me it loads quite fast...

  • To access the fields of CRM customized by using {module_data}?

    I know that I can access to CRM data on the site using {module_data = "v3" version resource "clients" =}.

    Is it possible to access CRM custom fields by using the tag {module_data}? If so, how do I?

    Hi Lynda,

    At the moment this is not possible because we do not support the extended in customers crm database api v3. We have it on our roadmap.

    Kind regards

    Radu

  • Detect when a person has presented a Web application using liquid?

    I have a web application that allows anyone to edit the items in a web application, however, I want only certain users to be able to edit this web application. I have some safe zones assigned to these users. I use module_data, so I don't know what secure areas, the user is subscribed to. I can then run the following logic:

    {% If RescueVolunteer is 'True' or Director is 'True' or Admin == 'True'-%}

    <!-FORM of CHANGE see - >

    {%-%}

    You do not have permissions to view this page. If there is an error, please contact us.

    {endif %}

    This works great but I ran into an issue. With this web application in particular, for each element, we add the field "presented by" so that the user will be able to modify this point. This particular user can change the web application element they are assigned to and are not attributed to one of the areas of security that has editing access.

    Is there a way to detect, using liquid, when a user is assigned to the subject field? In other words, I want to be able to do this:

    {% If file is 'True'-%}

    DISPLAY THE FORM

    {endif %}

    I checked the {{this | json}} but don't see anything that I could use. Is there something?

    I thought about adding the {module_webappcustomer} on the page to execute the logic, but I did not understand what a moment.

    No indication on how this can be achieved would be very appreciated!

    Hi Lynda,

    A solution we came up with many years ago, almost liquid, but still topical today, was to add in another field in the site web app called ' presented by ', and it simply reproduces the generation presented by feature. Place the email address of the owner of items in the web app in this new custom field to manually check if current logged-in user has access to change this point of current web application.

    It's barbaric, I know, but it works.

    Stephen

  • Sorting the output of {module_subscriptions}

    Hello

    I use the {module_subscriptions} tag to produce a list of zones that subscribed to a user connected.

    However, I need to sort the list alphabetically by the name of the secure areas. At present, the list seems to be output in the order that the zones have been created, rather than alphabetically by name.

    It does not seem a sort of this tag option in the documentation. Does anyone know of a different way to go about this?

    To give a bit of context, the Web site, we use the {module_subscriptions} tag on sells annual subscriptions to journals in PDF format, with 4 issues per year.

    So, we could have several secure areas, each containing 4 PDF files downloaded and secured through downloads of media in British Colombia, for example called "Journal A - 2015", "Journal A - 2016", "Journal B - 2015" and "Journal B - 2016". ""»»»

    If someone has been subscribed to all of these zones, the list should be displayed in alphabetical order, the following:

    Journal A - 2015

    Journal A - 2016

    Journal No. B - 2015

    Journal No. B - 2016

    rather than present, which is the order in which they were created:

    Journal A - 2015

    Journal No. B - 2015

    Journal A - 2016

    Journal No. B - 2016

    Thank you

    Richard.

    Instead, you can use module_Data as...
    {"{module_data resource ="zonecustomers"version ="v3"fields customer ="Area ID, secureZone, customerId,"skip ="0"limit ="50"where="\{'customer.id':'LOGGEDINCUSTOMERID'\} "order = 'zone ID' collection ="ZoneData"}

    Change the LOGGEDINCUSTOMERID to the id of the connected client and change order = what ever you need it to be.

  • With several Secure areas, how can you check that the user box is subscribed to when they are connected?

    So I guess it has to do with {module_data} and your API but I can't seem to understand this.

    I have 3 secure areas, basic, premium and pro and I want to use the liquid to display content on their page of account based on what secure area, they are advertised to. I know how to write the logic of the liquid, I feel like a dunce because I don't know which module to use to check where they are subscribers. Please when replying, don't slam me too hard upside the head because I don't know that it's right in front of me.

    I thank everyone!

    You can use module_data to get the information, but you still had the native module to do this:
    module_subscriptions | Developers of business catalyst

    You can run a collection and do what you want with the data.

  • Product weight and height of the tags

    Hey people,

    I'm doing a redesign of an existing online store and I'm changing how the width and height are displayed.  I have some products requiring an attached additional note (note I'm NOT in the description) that should be displayed if set to be made by a field on the product (as it will vary by product).

    Currently, custom fields 1 to 4 are currently all used for the different components that must be posted, two of them being the width and height. I want to be able to use the product properly and store these values in the appropriate fields, as seems to be the sensible way to do it. This then allows me also to reuse one of the custom fields to have a True/False value for supplementary note to be posted.  I looked at the other fields available with labels, but I don't want to use one of those that he will simply turn into a hack.

    I saw on a previous (from 2012) question than how to do, it was with custom fields, but I hope that this has been updated and the area is now accessible by a tag?  It seems silly that there is a value of products that are not accessible, especially when it seems that something a customer would like to know.

    Does anyone know if there are these tags?  Or if they can be created and that so how long that would take?

    Thanks for any help!

    I think it is 8 years since I first asked for these. There is something you can do however;

    You can use module_data product id the ID of the product to the great presentation of the product. Then you can get out the weight and size.

  • How to view all catalogs under on my homepage

    Please how can I view all the subsidiary catalogs a catalog of parent on my home page.

    If module_cataloguelistdump is not meet your needs, you can use module_data:

    Get all unique products to a specific catalogue and children · GitHub

    This is an excerpt from larger, but you can use:

    1 catalogue-hierarchical - iteration.liquid (you can remove the line 10 and 16 and enter your catalog of parent ID in the query)

    2 get-all-children-of - catalogue.liquid


    You will get a table with all the kids catalogs... you can change to a tree of your catalogs of output if you wish.

  • Rolling up the orders from customers at the level of companies

    I have clients who want to secure areas that lists the products they have ordered but were purchased by various employees of their companies. Employees connect, make the purchase but cannot see their own purchases. The supervisor company wants to open a secure session, see all orders and the status of payment for each, in effect, a dashboard of their purchase total, balances and payments to date. I can't determine if there is a way for these order data through mine through multiple clients that are part of this society. Any thoughts on this would be helpful.

    Hi Neil

    This scenario should be achieved using module_data and liquid.

    Below are a few items that will help

    module_data | Developers of business catalyst

    odule_data http://docs.BusinessCatalyst.com/developers/Liquid/Consuming-APIs-in-the-Front-End-Using-m

    Introduction to liquid

    Silviu

  • TemplateId liquid

    Is there a simple way to get this model id?

    {{templateId}}

    I want to make a logic as

    {% If myID == {{templateId}}-%} then do something...

    {endif %}

    Hi there, you can get the templateId using module_data and endpoint of pages

    Please use BC API discovered

    Try it and tell us if you need assistance.

  • Output {{productHeight}} and {{productWidth}} tags for calculation?

    Hello

    I need to perform the calculation using the height and width of a Liquid product, but with the fields for the dimensions of the product, I find no way out of these data. There is no standard tags from BC, nor liquids tags.

    I also looked in the BC Discovery API app and it shows the height and depth, but not in width.

    Someone at - he found how these tags to output?

    Thank you

    Paul

    Hi Paul,.

    You can use module_data to get the specific details if you're on the big presentation of the product.

    {module_data resources = 'products' version = "v3" field = skip "productWeight, productVolume, productHeight, productDepth" = "0" limit = "1" where = "\ {'id': '{{id}}' \}" = 'id' = "myData" collection order "}

    {{myData|json}}

    {{myData.items [0] .productVolume: time: myData.items [0] .productHeight}}


    productVolume is actually the width as written in "Product Dimensions"

  • How to show the image attribute of product in your cart

    The shopping cart product image display the image of product attribute instead of the image of the small product - {tag_productimage}?

    Should I use: {{CheminImage}}?

    Example:

    Bike Helmets have several attributes of COLOR - customer selects the color they want attributes then go in the basket.

    At present only the spectacle of image of commodity (like the BLUE one) - if I buy the helmet RED , the cart product image should change the color of the selected product.

    Is this feasible?  what I need to remove the color as an attribute and make all the products separated. Other wise why have attribute images?

    Please advise,

    Thanks, Siaka

    Possible but no way to practice.

    You must use module_data to get additional product information from the product data available in the basket. Assign groups and then the attributes in these groups are 2 separate applications.

    You will end up with a loop module_data inside another inside another BY product.

    Until some updates are made by BC to improve this, as you could, your in for some pain and double figure module_data use to do.

  • show/hide different shipping for the different combinations of product options

    Hi guys,.

    So far, Ive kept shipping options fun and easy for all my products with a standard plate or the next day for the entire site option.

    I sell bathroom tiles

    Now, I'm looking to sell MIC of tile, which means I have to deliver these separately from the bathroom tile.

    A new postage for MIC is placed £16.

    Now I can set it up so that if someone buys just pads the next day and standard options are not visible/selected, and if someone buys just tiles bathroom they cannot select the £16 trim option as a delivery charge.

    However it is someone wants to buy the two points that I have to charge times the delivery of bathroom tile and trim delivery price I did a 4th (standard + £16) and 5th (next day + £16) option combining the total amounts. Simple.

    The thing that I don't like the look of, it's that I have these options (4th and 5th) selected for all catalogs.

    This means that if someone buys a few toppings that they see in the drop-down menu pad option a £16, but also the option of 4th and 5th.

    This also means that if people buy just the bathroom tiles, they will see the standard and next day options, but also options 4 and 5 even if they have not selected toppings.

    Is there a clever way (I assume that java) to assert that the 4th and 5th options should show only if the two cataologe stripes and catalog of bathroom tile is selected at the same time. If not the two selected do not present options 4 and 5.

    I hope this makes sense. If someone wants to help, and needs more information, you know where to find me.

    Dave

    Not to find a smarter way to get your credentials so they don't sit in a parent category or have something in common.

    You can also assign the same weight for the catalogues of tiles and then use module_data to get these identifiers.

    But the simple is to paste the ID in a liquid:

    {% set inTiles = false-%}

    {% set inTrims = false-%}

    {% set tileCatalogIds = "211120,211121,211118,233354" | divided: "," %}

    {% assign trimCatalogIds "252612" = | split: "," %}

    {% for article on globals.cart.items-%}

    {% assign strId = item.catalogId: convert: "string"-%}

    {% If tileCatalogIds contains strId-%} {% assign inTiles = true-%} {% endif %}

    {% If trimCatalogIds contains strId-%} {% assign inTrims = true-%} {% endif %}

    {% endfor}

    If breaking down:

    We use these indicators and their default value false

    {% set inTiles = false-%}

    {% set inTrims = false-%}

    We are affecting our 2 separate tables holding our IDs, (note: the tables have strings)

    {% set tileCatalogIds = "211120,211121,211118,233354" | divided: "," %}

    {% assign trimCatalogIds "252612" = | split: "," %}

    For each item in the basket, convert us its catalogue ID to a string so we can compare to the above tables.

    We put the flags to true in the case of each if this is true

    {% for article on globals.cart.items-%}

    {% assign strId = item.catalogId: convert: "string"-%}

    {% If tileCatalogIds contains strId-%} {% assign inTiles = true-%} {% endif %}

    {% If trimCatalogIds contains strId-%} {% assign inTrims = true-%} {% endif %}

    {% endfor}

    The last part, only if the two indicators are true, which means that we have in our shopping cart at a tile and a pad to return the

    Then in the auto function JS, get us the select object and make a table with the options we want to hide/show

    -If we have our real flags, display us the options 4 and 5

    -If not all our flags are both true, display us options that are not of the 4 and 5

    -See us the default option

    All this can be achieved with liquid only, if you use module_data instead of tag_shippingoptions, and build your own shipping drop-down list.

    Benefits:

    • No JS
    • drop-down list will change when you remove the basket products (atm, it doesn't work, you need to add a timeout for your function to run)
    • much cleaner

    The end.

    Stoiky

  • of conteudo exibir como um blog em order ascendente

    Preciso sort uma lista UM Blog articles. I'm using a {module_blogpostlist} tag very a mesma não me ordenacao Parâmetro excellence.

    Hi Flavio,

    You can use module_data to get your messages and to order at your leisure as for:

    {module_data resource="blogposts" version="v3" fields="id,siteId,blogId,postTitle,postFeaturedImage,enabled,postUrl,slug" skip="0" limit="10" 'where="\{'blog.id':16506,'enabled':'true'\}" 'order="postTitle" collection="myData"}
    
    
    

    Please read the Introduction of liquid to help you on your way.

    Good luck, if you need more help, drop a line.

    Stoiky

  • With the help of liquid create a "Total registered" in the basket

    Hello fellow BC users.

    I know using liquid, we are now able to view savings products in small and large product pages, but my question is how we can convert only the shopping cart to create a "Total recorded" is it even possible?

    I tried several pieces of liquid code and even tried to add the value retail Custom1, but of course this is that a 'chain' is so impossible to be treated like a number.

    The website that I am working on http://cctvkits.info, it is a working progress but I would like 1 or 2 items that the customer has added that it would be marked as off sooner rather than later.

    As always help or advice then will be greatly received.

    Thank you

    Hi Tom,

    You will need to use module_data to get additional information for each product in the cart, because you don't have the tags for the retail price in the shopping cart layout.

    1. assign a variable that you will be totalSave.

    2. loop through cart.items and get the retail price for each product

    3. make the difference between that and item.price and multiply by item.quantity.

    4. use of the more filter, add this to totalSave.

    5. output in your page totalSave.

    Let me know if you need more help on this.

    PS You can convert the string customX in a number using the conversion filter

    Stoiky

Maybe you are looking for