How to add meta keywords in news item with contao - content-management-system

I am extending news module. I have to show meta keywords in news reader module. I have a keyword field in my decay. I have to set the keyword from dca to meta tag. I tried this using
$GLOBALS['TL_KEYWORDS'] .= 'keyword1,keyword2';
Its working fine. But I need to fetch the value from the record. How can the value can fetch from newslistmodule extended of my extension?

Related

TYPO3: tx_news modify news forms

I'm working on a magazine page. Therefor I would like the client to be able to select the design type when creating/editing a new post. So I'd like to add a custom field to the "edit news", something like a dropdown where all the news (design) types are listed.
For example: News Types:
Normal
Interview
Date
Special Event
etc...
When the client doesn't select anything it should fallback to a default i.e "Normal" and also it would be nice that when the client selects Interview a second input field shows up where he can enter the persons profession/description.
My goal is, that in the fluid template I can add a line where the selected news type will be added as a class to the list item, something like:
<div class="news-item {newsItem.type}">
// some code
</div>
will render out as:
<div class="news-item interview">
// some code
<div>
I'm not quite sure what I have to add to my custom extension that I'm using to accomplish that.
I appreciate all the help.
you need to extend the news data with further fields. This is described in the manual and this blog(ext:news is extended, but filestructure is old) and this article(current fielstructure, but other tabel is enhanced).
For the evaluation and displaying of your fields you need to modify the templates of ext:news. copy the neccessary parts into your extension and provide the modifications to it.
Also set the typoscript to include your templates like described in the manual.

Generate json feed from ext:news

TYPO3 7.6.16 ext:news 5.3.2
We're looking to create a json stream of news stories that have been created in the CMS so that we can consume the feed in other applications.  For each element in the feed we're looking include some simple properties such as the news story name, when it was published and a link to the news story, so that we can direct someone back to the relevant page on the Website.  
We've been able to return a list of news stories by querying the tx_news_domain_model_news table.  From this table we've been able to query all the information that we need from the story, but we're having trouble building a link to the story.
The links that the news plugin is building for each story at the moment takes the form:
/story/tx_news_pi1%5Bnews%5D=18&tx_news_pi1%5Bcontroller%5D=News&tx_news_pi1%5Baction%5D=detail&cHash=a6e542381e508c0501a09383cedc4d70.
So the id field of the news story field is included as a parameter.  We've tried making links by adjusting this parameter for the various Ids of different news stories, but each link allways returns the same news item.  So we are assuming that the hash value for each nwes story has to be calculated for each item to find the correct story.
Our question is.  Is it possible to build a unique URL for each story based on the information in the tx_news_domain_model_news table or is there a better way to create a JSON feed for each news story which includes the link to the original article.
You could define a special page rendering. either a new page or a new pagetype of an existing page.
You use a page object and instead of the usual include of a template the whole content is generated by a CONTENT object. With this you select all news records and define a renderobject where you can use FLUIDTEMPLATE or build up the rendering in typoscript.
In this way you can generate 'normal' URLs, which also might be niced by realurl.
If you want to output other formats than HTML you propably need to escape string-delimiters in your texts and strings.
Fluid templates may be a little bit complex if you have a format where whitespace is important. In typoscript whitespace can be handled with stdWrap.noTrimWrap

Store TYPO3 fluid request variables (i.e. searchform) for bookmarks

What's the best practice to be able to store fluid form variables as a bookmark (for simple search filter storing)?
We have a simple extbase&fluid plugin that shows searchfilters and searchresults. The filters are a collection of input and select fields, all created with . Fluid puts in a lot of extra parameters with _referred information and chash's into the request.
Now we want a visitor to be able to bookmark a search result easily. If we use a HTTP GET request, the URL sadly exceeds the URL variable limit because of all the extra parameters; and without them, the fluid plugin won't take on the arguments (unless we disable caching of the whole page?).
The best way (imo) is to generate a clean url that can be stored. In Fluid you can add a link with only the parameters you need and add an onclick event with JS to add this link as a bookmark.
<f:link.action action="yourAction" controller="yourController" arguments="{filterArguments}">Add Bookmark</f:link.action>
How to add the bookmark function with js(jQuery):
How do I add an "Add to Favorites" button or link on my website?
It is also a good practice to configure realurl to produce nice urls for your extension

How to add a movie in a typo3 news article

I'm using typo3 6.2.4 with the news extension to show some articles om my website. In one of the articles I want to add a youtube movie within a iframe. But it is not allowed to add html code. Does any one know how to solve this?
If you're talking about EXT:news, you can enable "Content element relations" in the extension configuration (in the Extension Manager). Then you can use every Content Element type as part of the News item, so you can add a HTML element or a Media element to display it.
By the way, if you host your video yourself, EXT:news accepts it as a media item as if it were a picture.

zend framework change meta with ajax

In my website with ZF, I get pages with an ajax call.
I want to change the meta tags (author, keywords, description) every time I do a new ajax-call.
I put these setName() method in the ajax-controller but it doesn't fill the meta.
$this->headMeta()->setName('description', $description);
$this->headMeta()->setName('keywords', $keys);
$this->headMeta()->setName('author', $author);
Is it possible? how is the correct way?