Description tag in HTML template

Q&A about the latest versions
Post Reply
User avatar
jare
Posts: 365
Joined: Thu Mar 19, 2009 1:26 pm
Location: RU/CZ
Contact:

Is it possible to set the *.ggt template file to add the description meta tag automatically from the User Data Description field to the html page?

I have tried to modify the Title line in ggt, using "description" instead of "title" but no result.

Code: Select all

<title><?ggs document.write(document.encode(document.removeTags(document.expandVariables(config.userdata.title)))); ?></title> 
User avatar
JimWatters
Posts: 329
Joined: Thu Oct 07, 2010 6:16 pm
Location: Saint John, New Brunswick
Contact:

Make sure that modified template file is saved as a new name.

Changing the line

Code: Select all

<title><?ggs document.write(document.encode(document.removeTags(document.expandVariables(config.userdata.title)))); ?></title>
to

Code: Select all

<title><?ggs writeUserdata(config.userdata.description); ?></title>
On the HTML5, HTML tab make sure your new file is selected in the dropdown list.
User avatar
jare
Posts: 365
Joined: Thu Mar 19, 2009 1:26 pm
Location: RU/CZ
Contact:

Thanks, Jim, this works!
User avatar
ArkiTonio
Posts: 96
Joined: Mon Apr 20, 2015 10:32 am
Location: Ascoli Piceno, Italy

Hi, Jim.
Following your explanation to jare I did the same and, yes, it works. But...
I have a tour, say "Apartment" (title), with some nodes, "Kitchen", "Living room", "Bedroom" etc. (descriptions).
Using your method...

Code: Select all

<title><?ggs writeUserdata(config.userdata.description); ?></title>
... I'd get "Kitchen", "Living room" etc. as titles for the pages, or, worst, "Kitchen" for all the nodes, being that one the first of the tour...
Instead I would title all the pages/nodes of the tour using the same title, the one of the entire tour.
I tried, obviously,

Code: Select all

config.userdata.title
, but with no success...
How can I get that result?
Thank you.

ArkiTonio
ArkiTonio
User avatar
JimWatters
Posts: 329
Joined: Thu Oct 07, 2010 6:16 pm
Location: Saint John, New Brunswick
Contact:

Having the template grab the title and description for the web page from the user data really only makes sense for single nodes.
By using the user data to get the title and description for a tour the data is coming from the first node of the tour.
The template should really have a data entry field for the title and description that encompasses the entire tour.
User avatar
ArkiTonio
Posts: 96
Joined: Mon Apr 20, 2015 10:32 am
Location: Ascoli Piceno, Italy

JimWatters wrote:The template should really have a data entry field for the title and description that encompasses the entire tour.
Well, Jim, I'm not sure what you mean...
Does the template have that field? Where is it?
Or should we provide it in some manner?...
Thank you.

ArkiTonio
ArkiTonio
User avatar
Hopki
Gnome
Posts: 13029
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi ArkiTonio,
When the web page is created it reads the content from the user data and writes it to the web page.
When you change nodes/locations this text will not get updated. So as Jim says only good for single node projects with their own HTML page or if a multi node tour use a name for the complete tour such as Park Tour.

However if you added a text box in the skin or if you don't want it in the panorama add a top margin so the text box is outside the panorama, then the text box can use place holders to display the user data for the current node.
Look at user data place holders in this Doc.
Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
User avatar
JimWatters
Posts: 329
Joined: Thu Oct 07, 2010 6:16 pm
Location: Saint John, New Brunswick
Contact:

Try this template and tell me what you think.
It adds two more fields on the HTML tab for Page Title and Page Description
These are initially grabbed from the userdata of the first or only node but can be updated to what you like.
Embed_p2vr2.ggt
Add Title and Description to the template to represent whole tour. Correct issue with special characters.
(23.98 KiB) Downloaded 217 times
User avatar
ArkiTonio
Posts: 96
Joined: Mon Apr 20, 2015 10:32 am
Location: Ascoli Piceno, Italy

Thank you, Jim: your template works very well! Exactly what I needed (even too many fields... I only use "Page Title"... for now!)
:D
Good job!

ArkiTonio
ArkiTonio
User avatar
ArkiTonio
Posts: 96
Joined: Mon Apr 20, 2015 10:32 am
Location: Ascoli Piceno, Italy

Ehm... Jim... Here's the first little bug... :?
Having some special characters in title, like "Santa Maria della Carità" (accented a, ASCII code 224, &#224; &agrave;), your template turns it to something like "Santa Maria della Carit�"...
Note that using that same title through the skin and placeholder $ut (User Data Title) gives the correct result: "Santa Maria della Carità".
Any solution?
Thanx

ArkiTonio
ArkiTonio
User avatar
ArkiTonio
Posts: 96
Joined: Mon Apr 20, 2015 10:32 am
Location: Ascoli Piceno, Italy

One more question, Jim: the fourth of the new fields, "Page Path"... what is it for?...
Thanx

ArkiTonio
ArkiTonio
User avatar
JimWatters
Posts: 329
Joined: Thu Oct 07, 2010 6:16 pm
Location: Saint John, New Brunswick
Contact:

I updated the template above to fix the issue with special characters. Download again.

When sharing a web page on Facebook, you need to have a fully qualified link to the panorama in the metadata of the page. To do this it is necessary to know, the server where the pano will be uploaded, the path on the server to the pano, and the name of the pano.

Both the title and description with the image is used when creating a Facebook post. If the pano is on a secure website than it can be interactive inside of the Facebook timeline.

For more information see this blog post.
https://ggnome.com/blog/embedding-and-f ... king-sites
User avatar
ArkiTonio
Posts: 96
Joined: Mon Apr 20, 2015 10:32 am
Location: Ascoli Piceno, Italy

Thank you very much, Jim. Also the special characters are correctly coded now.
:D

ArkiTonio
ArkiTonio
Post Reply