PDA


View Full Version : [code] tag


Gary Bolton
11-28-2005, 08:46 AM
Does anybody know how to fix the problem with the [code] tag so it get displayed correctly on the news page on the cmps page. So it doesn't go off the page and wraps the code correctly in the quotes.

As it seems to stretch the template width?

Brian
11-30-2005, 03:06 PM
Do you have a page where I can see an example of the problem?

Gary Bolton
12-01-2005, 02:40 AM
Here are some images I took as I don't want to leave the site messed up, But when you want I can make a post for you to look at if you want.

http://www.garybolton.pwp.blueyonder.co.uk/Snap1.gif

http://www.garybolton.pwp.blueyonder.co.uk/Snap2.gif

You can see looking at the banner on the site how it has pushed the site fixed width of 865 pixels out of alignment and the code is not wrapping, but instead going of the news thread page and also forcing the fixed width to go wider and forcing the blocks on the left and right sides also to go smaller in width as well.

Also I have the hack installed that list uncached templates. When I used that BBCode in that news post, it now list a template called "bbcode_code" a being uncached now from the dropdown menu in the footer, not sure why as I have no template called "bbcode_code" as far as I'm aware. When normally it would list all templates on the portal page as being cached.

Brian
12-01-2005, 05:31 PM
I seem to remember somebody else having a similar problem a few months back. IIRC, on their site they could add enough text so that the code box would start beneath the avatar image and that took care of the problem for them. In that case, I think it was mostly just trying to cram too much into too small of a space. If that doesn't work, the next best thing I could suggest would be to edit your 'bbcode_code' template and change the width setting there.

Also I have the hack installed that list uncached templates. When I used that BBCode in that news post, it now list a template called "bbcode_code" a being uncached now from the dropdown menu in the footer, not sure why as I have no template called "bbcode_code" as far as I'm aware. When normally it would list all templates on the portal page as being cached.
If you'll edit your News module and add 'bbcode_code' to the 'Templates Used' list then that should take care of that problem.

Gary Bolton
12-01-2005, 09:45 PM
Thanks Brian, I managed to use the guide you said to also fix HTML, PHP and CODE tags being displayed on the News module on the vBa Portal page.


For anybody interested here is what I did.

First off - it's better to have the "News Avatar" displayed on the RIGHT side instead of the LEFT in the NEWS module. Otherwise it pushes the start of the BBCODE over to the right side of the avatar making your code length very short. This doesn't happen if you move the avatar to the RIGHT side instead of the default LEFT side. This allows the code then to align fully to the left side of the news module so it can be displayed at a longer width.

To do this:

In the "adv_portal_newsbits" change the code in red below to read "right". And also add 2 break "<br />" after the avatar so if you only have lets say one line of text then some bbcode displayed it will create a space after the avatar. Otherwise the bbcode will cut through through the avatar because you only have one line of text, then your BBCode. Using the 2 breaks seems to avoid this problem.


<td align="$stylevar[left]" class="alt1" valign="top">
<if condition="$news['avatarpath']">
<img align="$stylevar[right]" style="padding:6px" alt="" border="0" src="$news[avatarpath]" title="$news[postusername]'s $vbphrase[avatar]" />
</if>
<br />
<br />
$news[message]

<if condition="$show['signature']">
<div>__________________<br />
$news[signature]</div>








Now go into these 3 bbcode templates and change the width in PHP, HTML, CODE to suit your center module width (you'll have to play around with the pixels width to suit your portal width).

[code]
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">$vbphrase[php_code]:</div>
<div class="alt2" style="margin:0px; padding:$stylevar[cellpadding]px; border:1px inset; width:$stylevar[codeblockwidth]; height:{$blockheight}px; overflow:auto">


change to: Change the pixel width to suit you!


<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">$vbphrase[php_code]:</div>
<div class="alt2" style="margin:0px; padding:$stylevar[cellpadding]px; border:1px inset; width:500px; height:{$blockheight}px; overflow:auto">


Then go into your edit modules settings and add these two extra templates to the News module. This will cache these templates, there is no need to add the PHP template as that is already listed and cached. But the two below need to be added so they are cached also.

bbcode_code,
bbcode_html

Should look like this:

adv_portal_newsbits, bbcode_quote, bbcode_php, postbit_attachment, postbit_attachmentimage, postbit_attachmentthumbnail,
bbcode_code,
bbcode_html


--------------------------
I have all 4 types of bbcodes displayed in one post at the moment on my portal page right now if you want to see the results





If anybody knows a better solution post it here.