Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Some questions regarding Title
Baseless
#1 Posted : Tuesday, July 26, 2011 7:18:41 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 6/10/2010(UTC)
Posts: 141
Location: Sweden
Hi
Have a couple of questions regarding the title management.
1. Is there any HTML Title inheritance built in? For example on would like item key as title but want the site name in the title for all pages. For example MyItem | MySite. If no, what is the API for it so that it can be manipulated directly in the view?

2. What exactly is content title good for? Is it to be able to expose a page variable to view content? If so, why does "@Page_Context.Current.HtmlMeta.ContentTitle" only give 'no definition' compilation errors?
jifeng
#2 Posted : Tuesday, July 26, 2011 7:42:58 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
1. Have not the function, also you can not changed the title value in a view. Because the html title is rendered on the top. But you can use the <title>@Page_Context.Current.HtmlMeta.HtmlTitle SiteName</title> instead of @Html.FrontHtml().HtmlTitle().

2.Where you got the "@Page_Context.Current.HtmlMeta.ContentTitle", it was changed to "@Page_Context.Current.ContentTitle", I think I forgot to make somewhere changed.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Baseless
#3 Posted : Tuesday, July 26, 2011 8:18:18 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 6/10/2010(UTC)
Posts: 141
Location: Sweden
Ok thanks for the intel. I saw it in the Page settings tooltip for Content Title i think.
jifeng
#4 Posted : Tuesday, July 26, 2011 9:25:27 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
Thanks.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Baseless
#5 Posted : Saturday, August 06, 2011 5:20:16 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 6/10/2010(UTC)
Posts: 141
Location: Sweden
Code:
<title>@Page_Context.Current.HtmlMeta.HtmlTitle | @("SiteTitle".Label("SiteTitle", "Layout"))</title>


A follow up question. Given the code above it will generate some html tags as well as well as the label itself. Is there an alternative for this giving only the label text?
BenGreene
#8 Posted : Tuesday, August 09, 2011 4:54:55 AM(UTC)
Rank: Member
Groups: Registered

Joined: 5/24/2011(UTC)
Posts: 21
Location: Melbourne, Australia
Baseless,

There may be an easier way, but the following code will do the trick (assuming that label text with the right key already exists):

Code:
SiteLabel.GetElementRepository(Site.Current).Get("SiteTitle", "Layout", System.Threading.Thread.CurrentThread.CurrentCulture.Name).Value
1 user thanked BenGreene for this useful post.
Baseless on 8/9/2011(UTC)
jifeng
#6 Posted : Tuesday, August 09, 2011 9:50:15 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
Baseless;4602 wrote:
Code:
<title>@Page_Context.Current.HtmlMeta.HtmlTitle | @("SiteTitle".Label("SiteTitle", "Layout"))</title>


A follow up question. Given the code above it will generate some html tags as well as well as the label itself. Is there an alternative for this giving only the label text?


The html tags is used to enable the inline editing. If the user have not the inline editing permission or you disable the inline editing function, it will not generate the html tags.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Baseless
#7 Posted : Tuesday, August 09, 2011 9:58:55 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 6/10/2010(UTC)
Posts: 141
Location: Sweden
jifeng;4631 wrote:

The html tags is used to enable the inline editing. If the user have not the inline editing permission or you disable the inline editing function, it will not generate the html tags.


Yes but if label is used for title then html tags are never needed. I can ofcourse type the title in plain text but i feel it more strutcured to have all key text presented with labels.
Baseless
#9 Posted : Tuesday, August 09, 2011 2:07:04 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 6/10/2010(UTC)
Posts: 141
Location: Sweden
BenGreene;4630 wrote:
Baseless,

There may be an easier way, but the following code will do the trick (assuming that label text with the right key already exists):

Code:
SiteLabel.GetElementRepository(Site.Current).Get("SiteTitle", "Layout", System.Threading.Thread.CurrentThread.CurrentCulture.Name).Value


Thx for that, shall try it out.
jifeng
#10 Posted : Monday, August 15, 2011 4:29:11 AM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,552
Location: Xiamen China
HI Baseless and Ben:

I will add a new api for label without any inline-editing tag, the new api will be:

"".RawLabel()
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
1 user thanked jifeng for this useful post.
Baseless on 8/15/2011(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.113 seconds.