Tags:
create new tag
view all tags

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

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin, ActionTrackerPlugin, ExtendedSelectPlugin, IfDefinedPlugin, LdapNgPlugin, RenderListPlugin, TagMePlugin, TimeSincePlugin
Server OS: Debian 3.1, kernel 2.6.8-3-686
Web server: Apache2 2.0.54-5sarge1
Perl version: 5.8.4-8sarge5
Client OS: Ubuntu 7.04
Web Browser: Firefox 2.0.0.3
Categories: Add-Ons

-- MichaelBryant - 22 Apr 2007

Answer

ALERT! 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

Change status to:
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2007-05-14 - MichaelBryant
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.