TYPO3 extension "news": Getting "Detail View" URL - typo3

I have started using the TYPO3 extension "news" and I would like to create in the LIST VIEW a "Facebook Like Button" for the Detail View of each enty. For this I need to fetch the URL of the DETAIL VIEW, not the whole <a> tag. How can i do this?
I tried this, but it didnt work:
<n:link configuration="{returnLast: 'url'}" newsItem="{newsItem}" settings="{settings}">
Link to detail page
</n:link>
It uses Fluid Templates, which I'm completely new with, so I don't know how complicated this actually is.

I found the solution. parameter uriOnly:
<n:link uriOnly='1' newsItem='{newsItem}' settings='{settings}'></n:link>"

Related

Get Page Name/ID of Content Element in Backend Edit View

I'm new to Typo3.
Inside the Configuration section of my own Content element I need the ID or name of the Content element's page. How would you implement that?
I already tried to use flux:field.input but I dont know what to do with typoscript.
record.pid was the thing I was looking for!
<f:debug>{record}</f:debug>

How can I pass an object to a specific view on a another page in TYPO3?

I have a simple controller with two actions:
listAction - shows a list of my objects
showAction - shows the detail page of an object
I am using a flexform for my plugin to define the detail page and can access to this via settings array in my controller. The standard view (list view) shows all my objects with a link to the detail page. This link will be generated by this fluid link action:
<f:link.action action="show" arguments="{example: example}" pageUid="{pageId}">details</f:link.action>
The generated links looks as follows:
details
I think that's ok and the redirect to the correct detail page is also working, but it seems that the show view is not showing up, because it will not be rendered. My showAction and my Show.html looks as follows:
Show.html
<f:layout name="Default" />
<f:section name="main">
<h1>Detail page</h1>
<f:debug>{example}</f:debug>
</f:section>
showAction:
/**
* Shows the details page
*
* #param \Fox\Example\Domain\Model\Example $example
* #return void
*/
public function showAction(\Fox\Example\Domain\Model\Example $example) {
$this->view->assign('example', $example);
}
So it seems that the action of the fluid link action viewhelper will be ignored. When I remove the pageUid="{pageId}" from the link action above I can see the show view, but then I will be not redirected to the correct detail page.
What am I doing wrong?
UPDATE
Ok it is working when I include the frontend Plug-In to the detail page, too. Is there a way to pass up the double include?
Ok it is working when I include the frontend Plug-In to the detail page, too. Is there a way to pass up the double include?
No, it is supposed to work like this - a plugin has to be present on a page if it should be rendered there. This presence can be indirect though:
You could reference the plugin (using a record of type "Include Records", or some reference mechanism from an extension).
You could include it using TypoScript (frequently used if it should
be on many pages).
Anyway, if there is no specific reason to have separate pages in the page tree for detail and list view, just put them on one page using the same plugin.

News 3.0.x - how to keep overwriteDemand

I have setup the TYPO3 news extension (not tt_news) to show a date menu with archived news items. From the archive menu, you can go to the list-view with all news for a given month. From the list-view, you can go to the details-view, to actually view the news item. In the detail view, I have configured the list-view as PageId to return to.
I think this is a standard setup and has nothing special.
The link from the date-menu to the list-view contains the GET parameter "overwriteDemand", which adds the month and year to the demand of the list view, so only the news articles for the given month/year are shown. Actually this GET parameter is not kept, when linking to the detail-view (with the n:link viewHelper) and therefore also not given back to the list-view, when I go back to the list-view from the detail view. The list-view therefore shows all news records after I come back to the list view from a detail-view.
Adding a javascript.back() button is no solution for me, since I want to use real links.
Am I missing something or is this a missing feature?
There are two ways to handle this.
the first option is, to edit the templates and add the parameters to the links using the arguments parameter of f:link.page (or something similar).
Second option is, create a new extension-template in the tree of the single page and add some typoscript, which keeps the parameters in the rendered link. The config name ist called linkVars and is descriped here: http://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#linkvars
tx_news uses <f:link.page in his templates. I just checked on github tx_news to see if it changed, but it still looks the same.
This is how tx_news generates the backlink:
<f:if condition="{settings.backPid}">
<!-- Link Back -->
<div class="news-backlink-wrap">
<f:link.page pageUid="{settings.backPid}">
<f:translate key="back-link" />
</f:link.page>
</div>
</f:if>
So it looks like the overwriteDemands are not kept. I think it would be a really good sugestion to the tx_news Dev-Team to keep the overwriteDemands in the backlink.
You have the {overwriteDemand} as an object in your template, so for now you can use something like this:
<f:link.action pageUid="{settings.backPid}" arguments="{overwriteDemand:{year: year, month: month}}">
First, you have to write a bit of typoscript to store the pagination currentPage :
lib.currentPage = TEXT
lib.currentPage {
value = 1
override.data = GP:tx_news_pi1|currentPage
}
In the paginated news list page, give the currentPage value to all links pointing to detail page :
<n:link newsItem="{newsItem}" settings="{settings}" configuration="{additionalParams:'&tx_news_pi1[currentPage]={f:cObject(typoscriptObjectPath: \'lib.currentPage\')}'}">
Read more
</n:link>
Then in the detail page, finishing by building back link to previous paginated list page :
<f:variable name="currentPage"><f:cObject typoscriptObjectPath="lib.currentPage"/></f:variable>
<f:link.page class="btn btn-xs" pageUid="{settings.backPid}" additionalParams="{'tx_news_pi1[currentPage]': currentPage}">
Back
</f:link.page>
;-)

Plone/XDV Related Item Overlay is Empty

I have a Plone 4 site using collective.xdv for the theme. Overlays for the login and contact form work fine.
But if I go to edit > categorization tab and try to add a related item, the overlay is blank. Looking at it in Firebug, the tags are correct down to div.overlaycontent. But inside of that div is my static HTML from the XDV theme's index.html.
Is there a special rule that I need for the overlays?
I cannot use plone.app.theming because this site is using more than just Plone.
In the xdv configuration(or append "##xdv-settings" onto site url), you can add unstyled paths.
I think what you'll need is:
^.*/referencebrowser_popup(\?.*)?$
or
^.*refbrowser_popup(\?.*)?$
If neither of those work, figure out the url that's being requested and add it as an unstyled path.

facebook comment plugin: remove like button

The FB: comment plugin comes with both a like button and comment box. Does anyone out there know how to remove the like button from the facebook comment plugin?
I got it working:
To remove (hide) the like-button that
comes above the comments-box To hide
the Like botton, you will need to add
2 attributes and create a CSS file.
1. simple="1"
2. css="http://yoursitedomainname.com/fb_comments.css"
<fb:comments expr:title='data:post.title'
expr:url='data:post.url'
expr:xid='data:post.id' simple='1'
css='http://yoursitedomainname.com/fb_comments.css'/>
in the css file add this style code:
div.like, div.like div {display:none;}
If you want you can just link to my
hide CSS file:
http://www.fileden.com/files/2006/10/3/258652/hidelike.css
Thanks to Gil Goldshlager, original post # forum.developers.facebook.net/viewtopic.php?id=58903
I've also searched for this answer but found nothing. I guess it's not possible for the moment. But if someone knows anything about this, I would also like to hear about it!
The answer from mctaco/Gil Goldshlager did not work for me. i assume, they only work with the old comments plugin. But i tried around with the tags and this one was working for me, to remove the like button:
<div class="fb-comments" data-href="{{ request.build_absolute_uri }}"></div>
This code comes from django. if you are using another server side language, then you have to replace {{ request.build_absolute_uri }} with the absolute uri from the page, where you want to have the comments plugin installed.
If you omit the data-href attribute, the like button is displayed.