similar looking guestbook and conctact form

Creating and modifying plugins.
Post Reply
daniello
Regular
Posts: 84
Joined: Thu Apr 09, 2009 11:47 am

similar looking guestbook and conctact form

Post by daniello »

Hi .. I installed the aformentioned plugins .. but they don't look alike. Is there any resource for two forms that have the same design? I have been staring at the guestbook tpl for a while now and am sure to mess up once I try adapting it.

Daniello
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: similar looking guestbook and conctact form

Post by yellowled »

daniello wrote:I installed the aformentioned plugins .. but they don't look alike.
I'm guessing this is about http://www.lowicki.de/s9y/? You should really always add a live URL, it makes helping you much easier. Besides, it's kind of hard to remember the URLs of anybody posting in here :)

Okay, the problem is fairly simple. You're using Bulletproof (BP). BP does have an individual template file (plugin_contactform.tpl) for the contact form, but not for the guestbook form (plugin_guestbook_form.tpl), since almost nobody uses the guestbook plugin and we're trying to keep the template files shipped with BP to a minimum.

So, you're gonna have to adapt the actual form in plugin_guestbook_form.tpl to match the form in plugin_contactform.tpl (everything after <div class="serendipityCommentForm">). Edit the plugin_guestbook_form.tpl you copied to /templates/bulletproof/ like this (you did copy it, right?):

Code: Select all

<form id="serendipity_comment" action="{$is_guestbook_url}#feedback" method="post">
<div>
    <input type="hidden" name="serendipity[subpage]" value="{$plugin_guestbook_sname}" />
    <input type="hidden" name="serendipity[guestbookform]" value="true" />
</div>
<fieldset>
<dl>
   <dt class="serendipity_commentsLabel"><label for="serendipity_guestbookform_name">{$CONST.NAME}</label></dt>
   <dd class="serendipity_commentsValue"><input class="frm" id="serendipity_guestbookform_name" name="serendipity[name]" value="{$plugin_guestbook_name}" size="20" maxlength="29" type="text" /></dd>
{if $is_show_mail}
   <dt class="serendipity_commentsLabel"><label for="serendipity_guestbookform_email">{$CONST.EMAIL}</label></dt>
   <dd class="serendipity_commentsValue"><input class="frm" id="serendipity_guestbookform_email" name="serendipity[email]" value="{$plugin_guestbook_email}" maxlength="99" type="text" /><br /><div class="guestbook_emailprotect">{$plugin_guestbook_emailprotect}</div></dd>
{/if}
{if $is_show_url}
   <dt class="serendipity_commentsLabel"><label for="serendipity_guestbookform_url">{$CONST.URL}</label></dt>
   <dd class="serendipity_commentsValue"><input class="frm" id="serendipity_guestbookform_url" name="serendipity[url]" value="{$plugin_guestbook_url}" maxlength="99" type="text" /></dd>
{/if}
   <dt class="serendipity_commentsLabel"><label for="serendipity_guestbookform_comment">{$CONST.BODY}</label></dt>
   <dd class="serendipity_commentsValue"><textarea class="frm" rows="5" cols="25" id="serendipity_guestbookform_comment" name="serendipity[comment]">{$plugin_guestbook_comment}</textarea>{serendipity_hookPlugin hook="frontend_comment" data=$plugin_guestbook_entry}</dd>
   <dt> </dt>
   <dd><div class="serendipity_commentDirection">{$plugin_guestbook_captcha}</div></dd>
   <dt> </dt>
   <dd><input type="submit" name="serendipity[submit]" value="{$CONST.SUBMIT}"></dd>
</dl>
</div>
That should about do the trick, but you're most likely going to have to do some more CSS stuff once the first guestbook entries appear.

YL
daniello
Regular
Posts: 84
Joined: Thu Apr 09, 2009 11:47 am

Re: similar looking guestbook and conctact form

Post by daniello »

I am making progress .. but very slow. I think I am stumbeling into code that was stuck in other places .. yet to be found by me .. but .. I'll keep on trying.

Two other design issues .. one related to this thread and the other .. as a side issue.

- the guestbook script is the only script that doesn't show a different HTML page title in the browser top bar. Is there a way to fix this? http://www.lowicki.de

- I have a small table in my right side bar. I don't know why it doesn't show the right border. If I set the table width to 90% it's there .. so it must be coded correctly. Is there a trick to make it appear ?

br
Daniello
onli
Regular
Posts: 3044
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: similar looking guestbook and conctact form

Post by onli »

Is there a trick to make it appear ?
The table is in a div which is smaller than the table if the page is small enough (Yes, you made the width of the table elastic by specifying it to 100%, but tables alway show their content, so the minmal-width of your table is defined by the width of the images).

You could fix this by using overflow: visible via css to the div, so the table would be shown, but this would result in this box being bigger than the one above. Better: Remove the border of the table and add the border to the div. Using css to position the images you could even use no table at all, which would help with this scaling-issues.
sincerely
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: similar looking guestbook and conctact form

Post by yellowled »

onli wrote:Better: Remove the border of the table and add the border to the div.
Even better: Use a reasonable (X)HTML element for this instead of a table. I.e. an unordered list, which would be correct semantically.

YL
Post Reply