I created a content to show the content of subpages.
<v:page.menu pageUid="{page.uid}" levels="2">
<f:for each="{menu}" as="item">
<v:content.render pageUid="{item.uid}" column="0"/>
</f:for>
</v:page.menu>
It works!
Is there a way to get only the content of the first subpage?
Use iterator in <f:for>:
<v:page.menu pageUid="{page.uid}" levels="2">
<f:for each="{menu}" as="item" iteration="iterator">
<f:if condition="{iterator.isFirst}">
<v:content.render pageUid="{item.uid}" column="0"/>
</f:if>
</f:for>
</v:page.menu>
https://docs.typo3.org/typo3cms/ExtbaseGuide/Fluid/ViewHelper/For.html#example-with-iterator-information
Related
UniPager Pagination. Is it possible to put absolute links instead of relative ones in "PreviousGroupURL" and "NextGroupURL"?
My code:
<PreviousPageTemplate>
<a href="<%# URLHelper.GetAbsoluteUrl(Convert.ToString(Eval("PreviousURL", true))) %>" >Previous</a>
</PreviousPageTemplate>
<NextPageTemplate>
Next
</NextPageTemplate>
<PreviousGroupTemplate>
...
</PreviousGroupTemplate>
<NextGroupTemplate>
...
</NextGroupTemplate>
HTML source page:
Previous
1
<span>2</span>
3
<a href="http://local/en/test?strona=3" >Next</a>
</div>
In your transformation use something like:
<%# GetAbsoluteUrl(Eval<string>("NextGroupURL")) %>
From https://devnet.kentico.com/docs/11_0/api/html/Methods_T_CMS_Helpers_URLHelper.htm
Please refer below URLs - -
https://docs.xperience.io/k11/references/kentico-controls/generic-controls/paging-controls/unipager
https://devnet.kentico.com/questions/repeater-and-unipager-in-a-custom-control-(widget)
https://devnet.kentico.com/questions/kentico-unipager-not-working
I'm using TYPO3 v. 8.7 and ext. vhs
Is it possible to make a condition that checks for current page? Have tried the code below but it does not work. I think it should then be possible to check for Current page
<v:page.menu expandAll="1" entryLevel="1" >
<f:for each="{menu}" as="menuPage" iteration="iteration">
<f:if condition="{menuPage.isCurrentPage}">
<f:then>is current page</f:then>
<f:else>is not current page</f:else>
</f:if>
</f:for>
</v:page.menu>
I don't know which version of EXT:VHS you are using, maybe an old one (as you wrote the deprecated v:page.menu instead of v:menu ).
You can discover all the options available for each item on the menu and their current value just using
<f:debug>{_all}</f:debug>
Like this:
<v:page.menu expandAll="1" entryLevel="1" >
<f:for each="{menu}" as="menuPage" iteration="iteration">
<f:debug>{_all}</f:debug>
<f:if condition="{menuPage.uid} == {data.uid}">
<f:then>is current page </f:then>
<f:else>is not current page</f:else>
</f:if>
</f:for>
</v:page.menu>
On version 6.0.0 (the one I am currently using) there are the boolean current and active so your code should be just:
<v:menu expandAll="1" entryLevel="1" >
<f:for each="{menu}" as="menuPage" iteration="iteration">
<f:if condition = "{menuPage.current}">
<f:then>is current page </f:then>
<f:else>is not current page</f:else>
</f:if>
</f:for>
</v:menu>
Plus, if you just need a different class for your "active" or "current" items, you can also use the v:menu arguments ´classActive´ and classCurrent
for example:
<v:menu expandAll="1" entryLevel="1" classCurrent="is-current" classActive="is-active">
<f:for each="{menu}" as="menuPage" iteration="iteration">
<li class="{menuPage.class}">
<f:link.page pageUid="{menuPage.uid}" title="{menuPage.linktext}">{menuPage.linktext}</f:link.page>
</li>
</f:for>
</v:menu>
I have temporarily resolved it as follows. But I don't think that's the nicest solution.
<v:page.menu expandAll="1" entryLevel="1" >
<f:for each="{menu}" as="menuPage" iteration="iteration">
<f:if condition="{menuPage.uid} == {data.uid}">
<f:then>is current page </f:then>
<f:else>is not current page</f:else>
</f:if>
</f:for>
</v:page.menu>
I am trying to get all headers which are not in the footer.
So the header <h3 class="ibm-bold">Discover</h3> should be excluded from the scrape.
<footer role="contentinfo" aria-label="IBM">
<div class="region region-footer">
<div id="ibm-footer-module">
<section role="region" aria-label="Resources">
<h3 class="ibm-bold">Discover</h3>
I have tried using this expression to select the headers which should be excluded, but it doesn't return the right nodes.
//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6]/ancestor::footer/text()
The page I am scraping is this: https://www.ibm.com/products/informix/embedded-for-iot?mhq=iot&mhsrc=ibmsearch_a
Please help
You almost had it.
//*[
(self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6)
and not(ancestor::footer)
]/text()
I'm using AsciiDoctor to create an HTML manual. In order to keep existing links valid, I need multiple anchors at the same header.
Basically I want this output:
<a id="historic1"></a>
<a id="historic2"></a>
<h2 id="current">Caption</h2>
While it is possible to create multiple inline anchors like this
Inline [[historic1]] [[historic2]] [[current]] Anchor
Inline <a id="historic1"></a> <a id="historic2"></a> <a id="current"></a> Anchor
it looks like additional anchor macros in front of blocks are simply swallowed:
[[historic1]]
[[historic2]]
[[current]]
== Caption
<h2 id="current">Caption</h2>
So what are my options to have multiple anchors in front of a block?
You can also use the shorthand version of this solution.
[#current]
== [[historic1]][[historic2]]Caption
Now you get all three anchors on the same heading.
The best I could do (tested with Asciidoctor.js 1.5.4):
== anchor:historic1[historic1] anchor:historic2[historic2] anchor:current[current] Caption
Some text
Output:
<h2 id="__a_id_historic1_a_a_id_historic2_a_a_id_current_a_caption"><a id="historic1"></a> <a id="historic2"></a> <a id="current"></a> Caption</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Some text</p>
</div>
</div>
There are two issues:
#840
#1689
In ExpressioneEngine, I'm creating a list with conditionals that is returning some strange behavior. The code below is part of a bigger set:
<li><h4>DERMATOLOGY</h4>
<ul>
{exp:channel:entries channel="specialist" dynamic="no" orderby="sp_order" sort="asc"}
{if sp_specialty == "sp_dermatology"}
<li>
<img src="{sp_headshot}" />
<p>{title}</p>
</li>
{/if}
{/exp:channel:entries}
</ul>
</li>
<li><h4>EMERGENCY AND CRITICAL CARE</h4>
<ul>
{exp:channel:entries channel="specialist" dynamic="no" orderby="sp_order" sort="asc"}
{if sp_specialty == "sp_emergency"}
<li class="{switch='one|two'}">
<img src="{sp_headshot}" />
<p>{title}</p>
</li>
{/if}
{/exp:channel:entries}
</ul>
</li>
What happens, in the case of EMERGENCY AND CRITICAL CARE, is that with the 5 entries I have under that, the classes are returned like this: two, one, one, one, two. Any suggestions on getting the behavior I need?
I see what you mean. The switch variable applies its logic to all entries returned by the entries loop - which is why you're seeing odd numbering in your rendered page - because it's applying them to entries returned by the loop that you are then applying conditionals to in order to do your grouping. You could use the search param to do some of that for you, returning only the entries you're looking for within each loop. Like this:
<li><h4>DERMATOLOGY</h4>
<ul>
{exp:channel:entries channel="specialist" search:sp_specialty="=sp_dermatology" dynamic="no" orderby="sp_order" sort="asc"}
<li>
<img src="{sp_headshot}" />
<p>{title}</p>
</li>
{/exp:channel:entries}
</ul>
</li>
<li><h4>EMERGENCY AND CRITICAL CARE</h4>
<ul>
{exp:channel:entries channel="specialist" search:sp_specialty="=sp_emergency" dynamic="no" orderby="sp_order" sort="asc"}
<li class="{switch='one|two'}">
<img src="{sp_headshot}" />
<p>{title}</p>
</li>
{/exp:channel:entries}
</ul>
</li>
This way each loop returns ONLY the matching items you're looking for, eliminating the need for the conditional and allowing the switch param to operate as it wants to - applying itself in alternating fashion to every returned entry from the loop.