Variables in PP Responsive Skins

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Variables in PP Responsive Skins

Unread postby Olivier Beltrami » Sun Jun 16, 2019 10:49 am

Hi,

I am in the process of converting my circa 2002 skin+project to a PP responsive one (I chose the Flat_Blue_Diamond_WebHelp.hmskin).

Overall it's going quite well, but I have hit a snag trying to apply my footer to the new skin. I have modified the _topicfooter.html file and inserted my current footer text.

Code: Select all
Topic <%TOPICHELPCONTEXT%> updated on <%TOPICLASTEDITED%>.<br>Topic URL: <a href="https://www.qppstudio.net/<%WEBHELP_VER%>/index.html?<%HREF_CURRENT_PAGE%>" target="_top">https://www.qppstudio.net/<%WEBHELP_VER%>/index.html?<%HREF_CURRENT_PAGE%></a>


But the result is not as before; all the variables do show something, but they do not get updated as I navigate from one page to the next.

Do these variable have a different meaning in the PP ?

Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Olivier Beltrami
 
Posts: 276
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France

Re: Variables in PP Responsive Skins

Unread postby Tim Green » Mon Jun 17, 2019 5:54 am

Olivier Beltrami wrote:Do these variable have a different meaning in the PP ?

Yes. You can't use per-topic variables in the template because of the way the topics are updated while browsing. Since this is a frameless skin (which is what users have been demanding for years...) it is not possible to load the entire topic page while browsing from one topic to another. Instead, only the topic content is replaced dynamically in the current page. When this is done the topic title and the topic keywords are also replaced, but topic-based variables are not currently available. They only work if they are in the actual body of your topic,

The problem with these variables is that they are actually only replaced with their values when Help+Manual publishes your project. For them to be in the template it would be necessary to replaced the entire template while browsing -- i.e. to reload the entire page, and that is exactly what you can't do with a frameless skin. The benefit, in addition to not having frames, is a massive speed increase. V3 skin topics load in between 15ms and 150ms, instead of a second or two for normal topic pages in frames, where the entire page and all its assets needs to be loaded.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
 
Posts: 21098
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Variables in PP Responsive Skins

Unread postby Olivier Beltrami » Mon Jun 17, 2019 6:50 am

Hi Tim,

Yes, I noticed that if I pressed CTRL+F5 then the footer would appear correctly.
How would I place this information in the body of my topic ?

Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Olivier Beltrami
 
Posts: 276
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France

Re: Variables in PP Responsive Skins

Unread postby Tim Green » Mon Jun 17, 2019 7:59 am

Olivier Beltrami wrote:Yes, I noticed that if I pressed CTRL+F5 then the footer would appear correctly.

Yes, because then you are reloading the entire page, including the entire template.
How would I place this information in the body of my topic ?

I didn't mean that you can put something in the page that would make the footer update, if that's what you mean; just that if you put topic variables in the body of your topic page (i.e. in the topic editor) then they will display correctly. With these skins you just need to avoid using topic variables in template page locations like the footer.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
 
Posts: 21098
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Variables in PP Responsive Skins

Unread postby Olivier Beltrami » Mon Jun 17, 2019 1:03 pm

Hi Tim,

Thank you for the explanations.

I now generate, first with an old skin, and I wrote a program that extracts the topic IDs and data last modified, before generating with the responsive skin and then retrofitting all the IDs and timestamps into the responsive files. A bit of a roundabout solution, but it works.

Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Olivier Beltrami
 
Posts: 276
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France

Re: Variables in PP Responsive Skins

Unread postby Olivier Beltrami » Mon Jun 17, 2019 1:42 pm

Hello again,

Actually, I am going bezerk trying to patch the generated responsive file to display the topic ID and date last changed.

I patch the HTM files and I can see the topic info is there when I look at the source in the browser. All the topic loads except the footer.

• Is it the topicfooter class which is doing weird stuff ? And then I should use <p normal> instead ?
• Or is it the .js file that I should be patching ? (it seems to contain the same information as the HTM file)

Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Olivier Beltrami
 
Posts: 276
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France

Re: Variables in PP Responsive Skins

Unread postby Tim Green » Mon Jun 17, 2019 3:09 pm

Hi Olivier,

Actually, I am going bezerk trying to patch the generated responsive file to display the topic ID and date last changed.

Sorry, perhaps I wasn't clear enough: In these skins it is not physically possible to display changing information in the topic footer. The footer is not part of the topic and will not change with the topic. It is part of the template and will always display only the information for the topic the user displays FIRST. After that, it it will remain the same for the entire session.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
 
Posts: 21098
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Variables in PP Responsive Skins

Unread postby Olivier Beltrami » Mon Jun 17, 2019 4:00 pm

Hi Tim,

Sorry for not being clear about your having been totally clear (which you were) 8)

My earlier error was trying to patch the individual .htm topic files.
What I am now doing is to patch each individual .js file in the jstopics folder.

In these .js files, I replace the final "CRLF}) characters, with the following stub (where I have previously replaced the topic IDs and dates.

Code: Select all
<p class=\"p_Normal\">\<br\>\<hr\>\<small\>Topic 000000 updated on dd-mmm-yyyy.\<br\>URL: <a href=\"https\:\/\/www.qppstudio.net\/webhelp_xe3\/HREF_CURRENT_PAGE\" class=\"topiclink\">https\:\/\/www.qppstudio.net\/webhelp_xe3\/HREF_CURRENT_PAGE<\/a>.\<\/small\><\/p>\n\r"
})

Seems to work in all cases (navigating the TOC or clicking on a topic link).

One thing I noticed with the responsive skins is that any minor change affects all the files. For example, if I just change the What's New topic and update the build number which appears in the header, then all 5000+ files of my project need to be uploaded again. Is this normal ?

Very best regards,

Olivier
Olivier Beltrami
https://www.qppstudio.net
Worldwide Public Holidays and Calendar Data
User avatar
Olivier Beltrami
 
Posts: 276
Joined: Mon Jul 15, 2002 3:30 pm
Location: Nantes, France

Re: Variables in PP Responsive Skins

Unread postby Tim Green » Tue Jun 18, 2019 8:11 am

Hi Olivier,

In these .js files, I replace the final "CRLF}) characters, with the following stub

If you do that you should also change the .html topic files in exactly the same way in the same places. Google is now very good at analyzing dynamic websites and it does notice if there are differences between the stored and dynamic versions of the pages, and it's best to keep them exactly congruent. However it would really be easier to patch something like this into the XML of your topic files, rather than trying to change the HTML output. Then you only need to do it once instead of on every publish and Help+Manual will take care of producing identical JSON and HTML versions.

One thing I noticed with the responsive skins is that any minor change affects all the files. For example, if I just change the What's New topic and update the build number which appears in the header, then all 5000+ files of my project need to be uploaded again. Is this normal ?

Changing a single topic will only affect that topic (both the HTML and JS versions), but changing anything that is used in all topics will naturally affect all topics. My guess is that the culprit here is the build number -- you will probably find that that is being written to all topics, thus making a change everywhere. 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
 
Posts: 21098
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany


Return to Help & Manual 7 Forum

Who is online

Users browsing this forum: No registered users and 4 guests