How to create link with article Id in news(tx_news) in typo3? - typo3-6.2.x

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.

Related

How to interpolate nuxt-link's `to` prop?

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.

TYPO3 Flux create extendable link list

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

Best way to locate link with protractor

<a href="someCoolLinkText.com">
<h3 class="main-header">
COOL LINK
</h3>
</a>
What is best way to find and click on this link?
Try to locate required node by its link text:
element(by.linkText('COOL LINK')).click()
Note that you should use text exactly as it appears on page, but not as it appears in HTML source code
Update
You can try to use ExpectedCondition to wait for link appearance in DOM:
var EC = protractor.ExpectedConditions;
browser.wait(EC.elementToBeClickable(element(by.linkText('COOL LINK'))), 5000).click();
You can use this xpath :- //h3[text()='COOL LINK']
The text COOL LINK is within <h3> tag so you can use xpath as :
//a[#href='someCoolLinkText.com']/h3[#class='main-header' and contains(.,'COOL LINK')]

Drupal 8 - Get comments area on custom template

I am trying to get the comment form with all comments on a custom template article page of drupal. I can get the whole content with {{ page.content }} or get the comments by using {{ node.field_comments }} and make a loop on it (assuming my field comment machine name is field_comments).
But does anyone know I to render the whole comments block with :
links to add a comment
comments
comment form
Thank you very much for your help !
Try to use the new and refined comment module. It's in the core so all you have to do is enable it. After that just make a comment type, add it to your article and display. That's pretty much it.
In template files for a content type (eg node--article.html.twig), you have the 'content' variable available. I use this bit of Twig to render the whole comments block:-
{{ content.comment }}
I struggled with this too, but just for the next visitor, I got 2 out of 3 (I didn't want the form on my page)
- links to add a comment -> {{ content.links }}
- comments -> {{ content.comment_node_TYPE }}
To get the correct name for content.comment_node_TYPE, visit your Mange fields page for that content type and see what the comment field is called
e.g. my "Audio" content type names the field {{ content.comment_node_audio }}
Hope this helps someone in future

Breadcrumb microdata help

I'm trying to help Google generate appropriate breadcrumb details for my website. I am currently using this as the breadcrumb:
<div id="breadcrumb">
<span class="crust" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.radonsystems.net" class="crumb" rel="up" itemprop="url">
<span itemprop="title">Home</span>
</a>
<span class="arrow">
<span>»</span>
</span>
</span>
<span class="crust" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.radonsystems.net/business/profile.2" class="crumb" rel="up" itemprop="url">
<span itemprop="title">Business Profile</span>
</a>
</span>
</div>
However, this isn't helping Google at all, even the testing tool does not generate the breadrumb link, though it does see the microdata and correctly identifies it as breadcrumb microdata.
Any ideas?
Instead of using the microdata schemas at data-vocabulary.org, I would use the newer ones at http://schema.org which is the joint project by Google, Yahoo and Microsoft. It has a wider range of schemas to be more expressive with your data modeling.
In particular, the webpage schema is what you want for defined breadcrumb microdata.
http://www.schema.org/WebPage
What I did was to add a new column, in which numbers could be entered as format: 1,3,4. Then, I retrieved it from the database, exploded it into an array, and for each number, I'd retrieve information about that link id: url, text, then output it.
If you want to list your pages, you need to create a version that contains enough substance that should be sought.