Sitefinity: How to set page title based-on the content item being viewed? - sitefinity

I have a page in Sitefinity 7 and its entire purpose is to show the detailed view of a custom content item.
So I've dragged-on a widget to the page, selected that it only shows one particular item only, without selecting which, because it should be whatever one was chosen from another page which caused them to navigate here.
One not-selected content item.
The page with the list control navigates to the detailed page.
But the page title is the same no-matter which is selected. I want the page title to be one of the content item's fields. How can I get the page title to be based-on the item we're viewing?

Edit the Awards widget on your details page and then go to the Advanced settings, then in the MetaTitle field enter the field name of your module you'd like to use, so in most cases "Title", then in the PageTitleMode field, you can enter one of a few options, Append, Replace or DoNotSet. Documentation on those options is here. You can also utilize the MetaKeywordsField and MetaDecriptionField by also mapping those to a new "SEO Keywords" or "SEO Description" long text field on your module for instance. Documentation on that is here.
The screenshot is from Sitefinity 6.3 but it should be the same.

Related

How to reset search item on Master Detail page?

I have link which navigate to Master Detail page and perform search, it works well.
But, when I change page and back again to MD (through navigation) search item still hold the value from link.
How can I clear search item when I change page?
Clear its value in Pre-rendering process.

TYPO3: login form on page + sub pages

In TYPO3, how do I get a login form to be the first rendered content element on a page and all its sub pages? I tried to check the "recursive" option but that doesn't seem to do the trick?
There are quite a few ways to set up something like this. Here's one approach:
Add a separate content section in your backend layout right above the current section.
Use slide to have pages inherit content for this section from their parent pages
Put the login form in that section on your the root page of your subtree.
This rather simple approach leaves control to the editor.
The recursive option you mentioned is very likely related to the record storage page and tells TYPO3 to look for records (here: users) in subpages of the selected page.

Get blog post custom field in template head - Sitefinity

I need to set several meta tag values in my page head to values set in blog post custom fields.
How do I access the blog item viewmodel from the head?
I've created a separate MVC view snippet for my custom head and referenced it in my template's layout, that much works.
Tried
I grab some of the same custom field values inside my blog template via references like Model.Item.Fields.MyFieldName.Fields.Title.
Adding this same line to the head template throws a
System.Web.HttpCompileException with little useful information attached. I somewhat expected this, as I suspect that viewmodel for the blog post only exists in the context of the blog widget.
Ends up that I need to rebuild after every change to the head cshtml file or I get this error. Seeing as this is about a four-minute process with Sitefinity (15 seconds to build, 3:45 to do whatever Sitefinity does for about four minutes), this is a gruelingly horrid thing to have to do.
However the Model is null at this level.
Also tried
Per the ever-helpful and highly knowledgeable #Veselin Vasilev, I looked into passing the data up via MetaDataFields. I didn't see these options in my admin section for the widget. To clarify, I'm using the built-in "Blog posts" widget with a customized view file.
But if it's possible to do this, it gives me hope that there's a way to pass more data up, even if it's going to take some work.
EDIT: Sitefinity v.10.2 and above:
There is an easier way to achieve what you are trying - in Page edit mode, in the Blog Posts widget click Edit and then Advanced. Then you should see a MetaDataFields button. Click it and you should see several meta data related fields.
In the MetaTitle field put the name of your custom field and save.
Also, from the docs:
If you leave MetaTitle field empty, Sitefinity CMS adds takes its value from the Title field of the static content item or from the identifier field of a dynamic content item. Otherwise, the tag is populated with the contents of the field that you have entered in MetaTitle field.
More details here:
https://docs.sitefinity.com/configure-meta-title-and-meta-description-on-widget-level
Sitefinity 10.1 and below:
Check this article
Basically, in your view you get a reference to the Page object and then update its Header with the meta data you need.

Ektron 9 - How to set Page Title (<html><head><title>...</title>...)

Noob question, but google is not giving me the goods:
How do you set the page title in a page in Ektron 9? You know: the text that goes into the title tag in the head of the html document.
In an Ektron 8 site I have used, there was a page title meta value that was used.
Does this work out-of-the-box?
If not, are there best practices?
What I have tried
Title of page is the "Content Title" not "Page Title"
New page widget does not have "page title" on alias screen as one pdf suggested
Googling "ektron page title" and variants did not throw up much.
Editing ektron page's folder properties did not show up anything.
Ektron settings "metadata definitions" does not have one for page title
Will keep you posted if I find the answer myself
Ektron does not create the definitions for Title, Description, Keywords or other SEO-related metadata out of the box (when you set up a min site, as is standard).
The site manager / developer defines those. How you set that on the page depends on your implementation and Ektron version.
For example, most 8.0 (and prior) sites will use the CMS:Metadata control in the of the master page (or page, if no master). The control accepts one dynamic parameter, so I used to place three controls, one for content (dynamic param = id), for forms (dynamic param = ekfrm), and for PageBuilder (dynamic param = pageid).
It's more common now (versions 8.5+) to see developers retrieving the metadata from the content (whether html / smart form, html form, or pagebuilder) using the ContentManager API method GetItem. This method accepts two params - the first is the ID of the item you want to retrieve, the second is boolean and, when set to true, will tell the API to retrieve metadata values. Once you have the values, you define the output.
Either method will work in versions 8.5+. The latter gives you more control.
Using Ektron 9 SP2.
We have a single line in the master page:
We use the DefaultContentID of the PageBuilder wireframe that is the front page. The other aspx templates just get the metadata of the HTML content item - all of our non-pagebuilder pages have a content block, then a bunch of smartform data.

Image slider link to internal or external page on Sitefinity

(Sitefinity 6.x)
I am trying to create an image slider where each image in the page links to an internal or external page. I created a separate library for all the images that I want to show on the slider then using custom MVC widget I display the images in a slider.The problem that I have is there is no place in the image where I can link the image to open an existing internal page or external website.
Is there a way to add a properties to the original Image properties? so that users can select a page (using some sort of page selector just like in the navigation widget) or type in external page to link. If that is not possible, could you give me some ideas how to implement this?
I've been creating image rotators using Module Builder in Sitefinity. What you could do is go to Administration -> Module Builder -> Create a Module, call it Image Slider, call the content type Slide. Add a couple fields, for the first call it Image and select Media for the type, this will use an image selector for the interface, then add another field called Link and use Short text for the type, this will hold the url. Unfortunately, Sitefinity doesn't include a Page Selector control as an available field yet so a text field will have to do. Save and activate your module, it will show up under Content -> Types of Content. Go ahead and add a few slides. Sitefinity has created a couple of widgets when you created the module, so if you edit a page, you'll see them under the "Content" widget section, probably at the bottom. Drag it on the page and set it to use the list template. Now open up the Sitefinity Explorer window in their Thunder Visual Studio plugin, under Common Widget Templates, you'll see an Image Slider folder, you'll want to edit the list template since you'll be outputing all the slides into some carousel markup or something. From here you can use the default Sitefinity image control and bind the link to a hyperlink that wraps the image control, this will link each image to whatever is in that field.
Hope that helps.