I want to create an extendable list of links with flux. That means I want a backend form to create and add as many links as needed. Using TYPO3 8.7, Flux, Fluidcontent, VHS. How do I do that?
Output Html shall look like this:
<h3>Links Headline </h3>
<ul class="mylist">
<li>Linktext one</li>
<li>Linktext two</li>
...
</ul>
Seems to be very simple, but I haven´t found a solution for it yet.
Thanks for advices
You can do this by creating a section in your flux configuration.
<flux:form.section name="settings.linklist" label="Definitions">
<flux:form.object name="listitem" label="Definition">
<flux:field.input name="label" label="Label"/>
<flux:field.input name="link" label="Link">
<flux:wizard.link/>
</flux:field.input>
</flux:form.object>
</flux:form.section>
Rendering the list in the frontend with:
<f:for each="{settings.linklist}" as="item">
For further information see the documentation: https://fluidtypo3.org/viewhelpers/flux/master/Form/SectionViewHelper.html
Related
I've been searching this for a while but can't seem to get it right. I have a basic Nuxt project with the following directory structure (ignore the fun.vue) :
The idea is to be able to navigate to a single post with paths like http://localhost:3000/posts/1
This works, if I manually go to .../posts/1 I get my page defined in _id.vue.
The problem is that, in my index page, I cannot get <NuxtLink> to go to single post pages. I have a basic v-for looping over my fetched posts array, like so:
<template>
<div>
<div v-for="post in posts" :key="post.id">
{{ post.title }}
<NuxtLink to="`posts/${post.id}`">Link to post</NuxtLink>
</div>
</div>
</template>
I would expect, upon clicking on the 2nd post's link for example, to navigate to posts/2, but instead I get /%60posts/$%7Bpost.id%7D%60. Why isn't the template string converted normally? I've also tried using a computed value with no success, and the Nuxt Routing docs haven't been of much help.
Highly appreciate any help regarding this.
You forgot the semicolon:
:to="`/posts/${post.id}`"
or even better
:to="{ name: 'post-id' }" // post-id or basically the name you gave to your component
As shown here: https://router.vuejs.org/api/#router-link-props
You can use something like this
the ":" in front of it will make it dynamic and you can use template literals
in between those double quotes
<NuxtLink :to="`posts/${post.id}`">Link to post</NuxtLink>
I tried your code in my development environment. You also may forgot to add "/" in front of "posts":
<NuxtLink :to="`/posts/${post.id}`">Link to post</NuxtLink>
If you put your code without "/" in a Nuxt "layout", it adds "posts" iteratively to your "URL" and makes the destination wrong:
http://localhost:3000/posts/posts/2
This happens when you click on post 1 and after to post 2.
I have article with uid xyz and pid foobar . How to create a link for the detail page using f:uri.action or f:link.page (or any other uri) outside news extension?
To answer the question to 100%, the links can be built by using
<f:link.page />
<f:link.page
pageUid="13"
additionalParams="{tx_news_pi1: {controller: 'News',action: 'detail', news:newsItem.uid}}">
{newsItem.title}
</f:link.page>
<f:uri.page />
<a
href="{f:uri.page(
pageUid:13,
additionalParams:'{tx_news_pi1:{controller:\'News\',action:\'detail\',news:newsItem.uid}}')}">
{newsItem.title}
</a>
You could also take the f:link.action ViewHelper
<f:link.action pageUid="{settings.detailPid}" extensionName="News" pluginName="pi1" controller="News" action="detail" arguments="{news:newsItem.uid}" >
{newsItem.title}
</f:link.action>
<f:link.page pageUid="{settings.detailPid}" additionalParams="{
tx_news_pi1:{news:newsItem.uid,controller:'News',action:'detail'}
}"> Detail Link </f:link.page>
Just change standard vars on your.
Only the content of the div is unique. So, in the following dynamically generated html, only "My Article-1245" is unique:
<div class="col-md-4 article">
<h2>
My Article-1245
Delete
Edit
</h2>
<p>O ephemeral text! Here today, gone tomorrow. Not terribly important, but necessary</p>
</div>
How do I select the edit/delete link of this specific div, using Selenium? assertText/verifyText requires an element locator, but I do not have any unique id/name (out of my control). There will be many such div blocks, with other content text, all dynamically generated.
Any help would be appreciated.
If text 'My Article' appears each time, you may use following:
//For Delete
driver.findElement(By.xpath("//h2[contains(text(),'My Article-')]/a[text()='Delete']"));
//For Edit
driver.findElement(By.xpath("//h2[contains(text(),'My Article-')]/a[text()='Edit']"));
Hope it meets your requirement :)
Matching by text is always a bad automated testing concept. If you want to keep clean and reliable test scripts, then :
Contact your web dev to add unique identifiers to the elements
Suck it up, and create selectors based on what's there.
You are able to create a CSS selector based on what you want.
What you should do is create the selector using parent-child relationships:
driver.findElement(By.cssSelector("div.article:nth-child(X) a[href^='delete']"));
As I am ignorant of your appp, this is also assuming that all of your article classes are under the same parent. You would substitute X with the number of the div you want to refer to. e.g.:
<div id="someparent">
<div class="...article" />
<div class="...article" />
...
</div>
So Im putting semantics on my page using RDFa Lite and the vocabulary Schema.org, but I have ran into an problem. Im putting it on a Person that is a soocer player. I got informations like player number, player position and so on? How do I define these with Schema.org?
So my code looks like this
<div class="indhold" vocab="http://schema.org/" typeof="Person">
<h2>Spiller - <span property="name" >Morten Jensen</span></h2>
<img property="image" src="http://e2.365dm.com/12/06/660x350/YannMvila_2775667.jpg" alt="Morten Jensen billede" class="spiller" />
<p><b>Navn:</b> <span property="name">Morten Jensen</span></p>
<p><b>Fødselsdag:</b> <span property="birthDate">1989-12-12</span></p>
<p><b>Hold:</b> <span property="memberOf"><span typeof="Organisation" property="name">FC København</span></span></p>
<p><b>Spillernr.:</b> <span property="playerNumber">2</span></p>
<p><b>Position:</b> <span property="playerPosition">Målmand</span></p>
<p><b>Beskrivelse:</b><br/>
<span property="description">Denne spiller startede i en meget tidlig alder, men var fast besluttet på at blive en kæmpe stjerne! Om få år spåes han en kæmpe fremtidig indenfor dansk fodbold! </span>
</p>
</div>
I have tried google, but Im not quite sure you can just create properties like that?
To extend schema.org to support custom properties you usually have to find a more generic type or property that is a superset of your custom term. In the case of playerNumber and playerPosition, I can't think of any property from schema.org that relates to these two custom terms. You could potentially use 'description' even though it is very generic, so something like:
property="description/playerNumber"
property="description/playerPosition"
In any case, this should not prevent you from publishing your content in RDFa lite. If you are not sure what to do about playerNumber and playerPosition, you can also just leave them out and not add RDFa Lite for them. You don't have to annotate every single item of your page, you can always improve that later.
You could also ask your question on http://lists.w3.org/Archives/Public/public-vocabs/, it is the official mailing list for the scgem
BTW, the rest of your markup looks good. Just make sure to move the typeof="Organization" into the span that has property="memberOf", since you are defining a new entity organization entity, it should be in the same HTML element as the property that creates it. Also, in schema.org, Organization is spelt in US English with a "z".
I saw in Expression Engine I can use {embed:title} and {site_name} variables, but now I need a variable to pull an excerpt or description of the article itself. Is there such a variable/tag?
ExpressionEngine tags are based solely on custom fields which you yourself have defined. So in the field group for your "articles" channel, you'll have some fields, maybe {article_summary}, {article_body}, {article_image}, etc. To display your summary, just use {article_summary} in your template.
I'm assuming that you're coming from something like WordPress maybe, where every piece of content has the_content() and the_excerpt() ... aside from a handful of global variables, and some fields which are universal to all entries (like {title}, {entry_date}, etc), ExpressionEngine isn't like that. You define what fields you use for each channel - you have complete control.
Here is the actual code you have to include in your EE template.
{exp:channel:entries channel="article" limit="5" dynamic="no"}
<div class="home_thumb">
<h1>{title}</h1>
<div class="home_thumb_img">
<img src="{article_image}">
{if article_content}
<p>{article_content}</p>
{/if}
</div>
</div>
{/exp:channel:entries}