DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Standard DNN Tokens in Page meta fields?

 9 Replies
 2 Subscribed to this topic
 26 Subscribed to this forum
Sort:
Author
Messages
Growing Member Send Private Message
Posts: 34
Growing Member

Hi all - 

In a previous installation, we found it very useful to utiltize Tokens as part of each page's title and meta descriptions in a "template site". Then when we copied that DNN portal to create individual franchise sites that used the same set of pages, the page title and meta description would include unique site names rendered from the token ( [Portal:PortalName], etc.), so a page title of "Advanced Cisco Training from [Portal:PortalName]" could replace the token with the specific portal name. 

I've realized that functionality of being able to use tokens in the page meta was a function of DNNSharp MyTokens, which is no longer available as a standalone product. Is anyone aware of some open source equivalent add-on to get that functionality? 

Thanks! David

Veteran Member Send Private Message
Posts: 1196
Veteran Member
AFAIK there is no Open Source replacement for DNNSharp Tokens.

But this specific issue you could replicate by using our Style Helper in your Skin.
I added an example here: https://github.com/40fing...Change-Meta.ascx#L24
Senior Member Send Private Message
Posts: 1542
Senior Member
Along the same lines, we never used the MyTokens extension, but we've found tokens to be useful in a few recent projects and ended up building a template that does this for us in OpenContent. Unfortunately, I'm not sure yet if I can share it with our other open-source OC templates.
Growing Member Send Private Message
Posts: 34
Growing Member

Hi Timo,

Thanks for directing me to your Style Helper skin object! I can see where that will be really useful for many purposes. 

If I'm understanding your ChangeMeta attribute demo correctly, it looks like it would be basically replacing the default (or user-defined) DNN page title or meta description with whatever content I created within the skin, and could use any of the standard DNN tokens to construct that?   Would there be any way to incorporate the text that has been user-created for the page within the page properties and perhaps prefix that with a token value? We'd still like to be able to customize the page titles and meta descriptions per-page, but then include a token value.

Thanks! David

Growing Member Send Private Message
Posts: 34
Growing Member

I can vouch for Will's token-definition tools created within OpenContent working well when specifically designed to be used within other purpose-built templates he created!

Veteran Member Send Private Message
Posts: 1196
Veteran Member
Posted By David Fenske on 10/22/2024 4:56 PM

Hi Timo,

Thanks for directing me to your Style Helper skin object! I can see where that will be really useful for many purposes. 

If I'm understanding your ChangeMeta attribute demo correctly, it looks like it would be basically replacing the default (or user-defined) DNN page title or meta description with whatever content I created within the skin, and could use any of the standard DNN tokens to construct that?   Would there be any way to incorporate the text that has been user-created for the page within the page properties and perhaps prefix that with a token value? We'd still like to be able to customize the page titles and meta descriptions per-page, but then include a token value.

Thanks! David

Well, not exactly that way...
The StyleHelper target controls in default.aspx (you pass their ID)
There are some for the Meta tags, but the title is injected in another way.
Because the Title is injected in another way, SH currently does nto support changing it.
(could be a useful addition though ;-)

Also SH does not implement full token replace support, but a limited set of tokens you can find here: https://www.40fingers.net.../DNN-Stylehelper#493

HTH Timo

 

 

 

Advanced Member Send Private Message
Posts: 128
Advanced Member
We used our inbuild tools for this. (Open Source) It's based on the old localization tool build by Eric back in the day. We took the concept and adapted to our needs, so it's localizable and deals with all SEO data on the page.

The documentation is currently offline, I'm working on getting it back online. But you can look at the github version in the meantime.

https://www.rocket-cds.org/
https://github.com/Rocket-CDS

https://github.com/Rocket...tion/Installation.md
https://github.com/Rocket...e/master/RocketTools

Get in touch with me if you need a hand using it.
Advanced Member Send Private Message
Posts: 128
Advanced Member

I have updated the documents https://docs.rocket-cds.o...gration/Rocket-Tools

It's not exactly what you ask for, but I think the Page localization is a good way to deal with SEO even when there is only 1 language.

Growing Member Send Private Message
Posts: 34
Growing Member

Hi David, 

Rocket Tools looks like an amazing project - lots of features. I think for the small functionality I'm looking for, it's a bit too much to get into, but I'll keep it in mind for future projects!

Thanks, David

Advanced Member Send Private Message
Posts: 128
Advanced Member
Yes probably a little much for this. It's a merge of all our internal modules, We've been using it for over 2 years and it stable, just lacking some AppTheme (razor) template examples and documentation needs to improve.

These Forums are dedicated to the discussion of DNN Platform.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved