How to modify the browser title dynamically in DNN 9 Series - dotnetnuke

Within DNN 9+, if we want an organization name followed by the page name in the browser tab, what would be the best way to dynamically incorporate this for multiple pages?
I've tried modifying the DNN (DotNetNuke) 7/8/9 c# Compiled Theme package through Visual Studio 2015, but no luck. It appears that the templates only allow you do manage code between the body elements. Any advice would be great!

By default the page name consists of the Portal Name and Tab Name (Unless you have specified a Title in the Page Settings, then it's just the Title).
PortalSettings.PortalName + " - " + PortalSettings.ActiveTab.TabName;
So if you change the Portal Name, you will already get what you need.
If the Portal Name is not an option, you can change the title using javascript. Just add this snippet to the .ascx Skin File.
<script type="text/javascript">
document.title = "<%= "StackOverflow - " + PortalSettings.ActiveTab.TabName %>";
</script>
If you want to do it neatly for SEO purposes etc you will have to create your own Skin Object or Module.

Related

How to edit Default.Page.Template Content in DotNetNuke?

How to change home page content in DNN while creating a site itself.
I need to change different page. I created a new page and created Template. And I replaced inside Templates folder named (Default. page. template). But it is not working out. Provide me a better solution.
Probably the easiest way to do this is to create a site using the default template, edit that site to create your own site, and then save that as a site template (suitable named). You can then use that site template to create sites with the page structure that you want.
The default page template (I believe) is used when you create new pages using the the Pages UI. I don't believe that the default page template is used by the default site template.
If you have created a page and would like to apply a specific page template to the new page retroactively. To do this, go to the page that you want to change and append ?ctl=ImportTab to the url. That will bring up a dialog that allows you to change the emplate for a page with lots of options. It

Editing the body tags on specific Joomla articles

I need to add Call tracking for a Marketing campaign on my site that is currently housed in Joomla. It requires a certain script to be added inside the <body> tag only on designated pages.
I know I can add the script tag to the template but that would make it apply to every page. I am still new to Joomla, so can you tell me if there's a way to apply the script below to only the pages we want to track calls from? It needs to go before the </body> tag.
<script type="text/javascript" src="//cdn.callrail.com/companies/808848127/e001797b95eaf41026e7/12/swap.js"></script>
The easiest way to add a script to selected pages is to use an extension such as the professional version of the EasyScript plugin, the Flexi Custom Code module or similar.
It looks like you could also do this with Blank Module which is free. Publish the module to a non-display module position such as "debug" or similar and enable the module only on the required pages by selecting these under the Menu Assignment tab.

ddrmenu razor doesn't show anything in dotnetnuke

For our website we want to use a megamenu that is created with razor.
In the Gravity skin folder of DNN, we have created a folder called MegaMenuNav and we have added our MegaMenu.cshtml and menudef.xml into it.
We have downloaded the ddrmenu example and used it like this:
<dnn:MENU ID="MENU" MenuStyle="MegaMenuNav" runat="server" NodeSelector="*"></dnn:MENU>
we get no error, but nothing is shown as well.
All of the example menus that use token or xslt, such as Dropdown and Mega2DNN are shown, but when we use Razor menus, nothing is shown.
For testing, we added a simple text inside our MegaMenu.cshtml, but again we got no result
Is there anything to do with dotnetnuke?
BTW, we are using .Net 4.5 and Dnn 8.0.2
Thanks in advance

Display content from sub pages

I would like to make sub pages under and existing page. Lets say the page is "Success Stories" and under this page the user can enter in other pages and format them any way they want. What I need is a way to make a repeater of all these subpages with stuff like the page title, a little bit of the content, and a button that links to the actual page.
Is this possible out of the box? I am willing to buy a module if it is reasonable;however a Google search returned no results.
Thank you.
The best option I know is Child Links from Ventrian.
You can show all children with title and description & links. (NOTE: description is Page description NOT content from the page.)
what version of dotnetnuke are you using?
Two options:
ONE
There is a copy page function where you can choose what modules and setting to copy to the new page.
Under the pages menu - click copy page
then you can select what page to copy from, and then it will list all modules on that page. You can choose to copy the module with or without content or even reference the module on the source page.
TWO
Other than that you can create a page template that a user can select that is pre-designed by you. Create the base page the way you want it and then click export page under the page / edit page menu depending on your version. A template will be created in your portal template folder that can be used when creating new pages.
If you are looking to automate this process, then you will have to look into a custom module or design a sql script you can run yourself (but this is a lot more maintenance as it can change with every version.)

How do I name a drupal page template file according to a node's url path setting?

I'm new to drupal and having trouble naming a page template file. In drupal 7, let's say I've created a basic page with the url path as:
www.example.com/my-page
When I create a custom page template file, I've been able to get the file name page--node--[nid].tpl.php to work fine. However, I have 3 different sites (localhost, development, and production) and each has a different node id for this page (because the databases aren't sync'd). I need to find a way to name the template file according to the url path. I've tried all of the following, none of which has worked:
page--my-page.tpl.php
page--my_page.tpl.php
page--node--my-page.tpl.php
page--node--my_page.tpl.php
Any suggestions?
Check out the theme developer module. With it you should be able to get a list of possible template names that are being considered.

Resources