Many Blank Templates Appear In Template List

Bugs » #6


This section on the Community is no longer supported, in favour of Wikidot's Official Feedback Site.

It is retained here for archiving purposes.

Posted by Phil ChettPhil Chett on 30 Apr 2008 10:12, last edited on 04 Mar 2009 14:01

This bug has been fixed

Description

When using templates on your site (pages with template category), creating a new page presents the "Initial template" dropdown box with each template followed by "no template (blank page)". This is ugly and a little confusing.

How to Reproduce

just create a page and use the template selector.

Browsers

all

Has bug

Works correctly

Workarounds

none

FIX!!

thanks to andrewescott
Looking in the source code for Wikidot v1, the problem seems to be in the file /templates/modules/edit/PageEditModule.tpl

<select name="theme" id="page-templates" onchange="WIKIDOT.modules.PageEditModule.listeners.templateChange(event)">
  {foreach from=$templates item=template}
    <option value=""  style="padding: 0 1em">no template (blank page)</option>
    <option value="{$template->getPageId()}"  style="padding: 0 1em" 
      {if $template->getPageId() == $templateId}selected="selected"{/if}>{$template->getTitle()|escape}</option>
  {/foreach}
</select>

It seems clear that the "no template (blank page)" option is repeated for each template in the list. The solution ought to then be to move the "no template (blank page)" option to above the foreach loop.

Contact

Rate this Bug

Rate the urgency of this bug. If you think it is more urgent and important than it's current rating suggests, rate it up.

rating: +3+x
Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.