Question
Hi, I'm having a problem where the blog topic isn't being viewed correctly (using
BlogAddOn). The post I created doesn't have the title of the topic, date/author/tag, and the comments section when viewing the TWiki topic. The only content in the topic is the actual text and underneath it is a link to the BlogPostForm. The example topic created automatically looks the same way, too.
I created the blog post using the BlogPostCreator. The blog post does render properly on the BlogPost page, though it's only a "preview" of the topic (which is expected). From what I can tell, it doesn't look like the add-on is using the BlogPostViewTemplate.txt template at all. That template file is in web's directory along with all the other _BlogAddOn files.
I would greatly appreciate any help to get this working. If anyone needs any more information, please feel free to ask. Thanks!
Environment
--
MichaelBryant - 22 Apr 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
I have experienced this issue with some co-workers. For some reason the
VIEW_TEMPLATE setting is not always copied over from the
BlogPostTemplate to the new topic. Until know I have only seen this on Mac Intel computers.
I cannot reproduce this myself, so any help into localizing the cause of the problem is welcome.
For now you can set the setting in the "Settings" page (first option in "More"):
* Local VIEW_TEMPLATE = BlogPostView
--
ArthurClemens - 22 Apr 2007
Yes, setting
VIEW_TEMPLATE manually for each topic does work. Thanks!
I think I've found what causes this bug, though. When you create a new blog post, if you save and don't preview the post, then the
VIEW_TEMPLATE setting gets copied over to the TWiki topic. However, if you preview the post and use the save button on the preview page, then the
VIEW_TEMPLATE setting does not get copied over. I've tested both scenarios over 10 times and everytime I get the same result. So, this bug seems to only happen when using the save button on the preview page.
I've tried debugging the Save.pm module but I don't know enough about TWiki yet to find anything useful. I'll keep trying though, as time permits. Also, I'm not for sure if this is related or not, but on the preview page the
VIEW_TEMPLATE isn't used. That might be an indication that Save.pm (or Preview.pm) is stripping the
VIEW_TEMPLATE setting.
Any ideas?
--
MichaelBryant - 24 Apr 2007
Many thanks for the hint!!!
--
ArthurClemens - 24 Apr 2007
The way variables were passed in the edit and preview templates was not correct.
In pattern skin I have made these changes to the hidden form fields:
In
edit.pattern.tmpl I have changed:
<input type="hidden" name="templatetopic" value="%TEMPLATETOPIC%" />
to
<input type="hidden" name="templatetopic" value="%URLPARAM{"templatetopic"}%" />
In
preview.pattern.tmpl I have added this line:
<input type="hidden" name="templatetopic" value="%URLPARAM{"templatetopic"}%" />
--
ArthurClemens - 09 May 2007
That worked! Thanks, Arthur! I made the changes in
edit.blogpost.tmpl and
preview.blogpost.tmpl, which are both copies of the edit and preview pattern skin templates, and set the
SKIN variable to
blogpost, pattern in
TWikiPreferences. That way the changes will not get clobbered on upgrades.
--
MichaelBryant - 14 May 2007