Suggestion - total override

Feb 1, 2014 at 6:24 PM
It would be nice to have a total override option on individual pages, what I mean is, right now the override title is displayed with the site name unless the site name is turned off completely. It would be great to have a way to leave the site name turned on, but in a specific page type an override title that displays without the site name.

Also, I guess this is more of an issue, but do you forsee being able to make the Page Title Override module work in cases where we have customized the document.cshtml? I am able to get away with not customizing it right now, but I can see that being a problem in future.

Feb 1, 2014 at 6:36 PM
Hi Again,

To resolve your second question, the easiest way would be to copy my version of "Document.cshtml" into your theme "Views" folder. At that point, you could edit the rest of the document as you see fit while still retaining the document title override section.

For your first question, you would need to expand the Model, Drivers, and Views to accept a checkbox option called something like "Override Full Title". This would pass in as a variable (Boolean) allowing you to override this portion of "Document.cshtml":
<title>@Html.Title(siteName, title)</title> 
It would turn into something like this:
bool fullTitleOverride = WorkContext.GetState<bool>("FullTitleOverride");

@if (fullTitleOverride) {
else {
     <title>@Html.Title(siteName, title)</title> 
That is not tested code, but I believe it would work properly. Your model, driver, and views would capture and sett the variable in FullTitleOverride. I am guessing that between this and the other question you just had it would take about an hour or less to wrap it out. I just don't know when I will be back on this module (been busy on a lot of Commerce modules lately for Nwazet.Commerce extensions). If you want to fork and make the changes, gladly pull them in for you. Love to see this module being used.
Feb 4, 2014 at 2:55 AM
Edited Feb 4, 2014 at 2:57 AM
I have made the change and committed it to a fork, so feel free to grab it.

Thanks, the module has been very helpful
Feb 4, 2014 at 12:24 PM
Awesome, can you press the Pull Request option on your fork in order to make it easier to visualize the changes and complete the merge? I am sure I can do it otherwise just that way is nice and gives you credit for your hard work.