Looped dynamic content in Components, used in accordions, not working

I am circling back to this topic, because it still does not work. My last post has been closed, so I am oping a new one.

I am re-describing the issue. First, this is the component I am using for this test. It is very simply: a Div containing a Text Element, which in turn contains dynamic contents pulling the post titel. The Div is exported, and I will use it’s shortcode later.
image
image

I am using that component on this page: https://wordpress-780768-2659923.cloudwaysapps.com/testpage/

The page has two Sections which are identically set up: Section > Row > Column > Accordion
The column is a Looper Provider for “Recent Posts”, and also a Looper Consumer that consumes 2 posts.


The accordion contains in the header and in the content {{dc:post:titel}}.

In Section 2, in the content, I have replaced {{dc:post:titel}} with the reference to the component shortcode described above.
image

Observation: The shortcode does NOT produce the post titel of the looped content, but instead it produces the page name (“testpage”)

Additional note: Within Cornerstone, the first consumed post/accordion does show the correct post title, but the second post/accordion (and all after, of more than two are consumed) do show “testpage” also within Cornerstone.

Hi @striata,

Thanks for reaching out.
The components can be used to show the content that has been executed already, as you have added the {{dc:post:title}} into the component it executed that Dynamic Content before the Looper. What I would suggest you can create the component with the Accordion and the Looper and use that in any section.

Hope it helps.
Thanks

Dear @tristup, I am not sure how to achieve that.

The specific application is an FAQ list. When all accordions are closed, the user sees a compact list of questions. If the user wants to read an answer, he can open the corresponding accordion. The answer is not only text in my case, but a standardized formated “article” with headline, image, bullet list, and a text paragraph. All the “data” for the FAQ is CPT / ACF.
My whole reason for using the component is to inject this highly formated and styled “answer” (Div with content in it) into the accordion content, which only accepts text/html/shortcode.
That Div’s content would contain several {{dc:… }} fields, drawing from my custom FAQ post type und set up with ACF.

Which organization / nested structure do you suppose can achieve this? On any page containing an FAQ section on my website, I would set up a looper with an appropriate query string to filter and show only those FAQs that belong on that page.

My thought was that the “answer” could be the component, but you mentioned that it is populated before the looper, rather that injected “raw” into the accordion and living inside the scope of the looper.
Is there a downside to changing the scoping (order of execution) of accordions?

Hi @striata,

I suggested creating a component with the Looper Provider and Accordion which shows the Title and Content using the Dynamic Content tag. And use that component wherever is required. In that way, the Question and Answer will come from the component.

Hope it helps.
Thanks

I am not quite there yet. So, I do need a component that represents each styled “answer” of my FAQ. Let’s just say that it is a Div, and lets call that component “answer-Div”. The Div contains {{dc:…}} fields referencing the entries in my FAQ-ACF. I need to export that component in order to have a shortcode available to reference “answer-Div”. I can then drop the shortcode of “answer-Div” into the accordion content.

Where is then the accordion? Also in a component-document? But as soon as I place “answer-Div” into the accordion, it will be executed, and the {{dc:…}} fields will be gone and replaced by static text.

Hi @striata,

It will be very difficult to explain here, but what I am trying to say is that convert the Test Page content into the component and use it wherever it is required. It might be a little complex, if you are not proficient in this, I would suggest you hire a developer who can assist you to do the customization or you can avail of our newly launched service called One, where we answer the questions beyond normal theme support.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.