Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

help with simple table for “quick overview” — find hidden <br /> tags…
 
Bowen
Member
 
Avatar
Total Posts:  37
Joined:  2008-04-09
 

OK, this should be VERY easy for someone who can tell me where to go.  I want to create a nicely styled table under the “Quick Overview.” I jacked some code from another site (don’t remember the site now) and pasted it into the description block. 

Now it shows up on the frontend but firebug shows about 30 break tags before the table and i don’t know where they are.

have a look, you can see the table has dropped to the bottom of the page:
http://www.bowenimagery.com/shop/prints/photo/hibiscus.html

im sure the solution is obvious to someone, thank you in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nobby
Jr. Member
 
Total Posts:  22
Joined:  2008-06-23
 

the best place to look is in the template/catalog/product/view.phtml

<div class="short-description"><?php echo nl2br($_product->getShortDescription()) ?></div>

Not sure about your theme but i suggest you try removing the nl2br command as a first step as this converts line feeds in the data to <br>’s

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bowen
Member
 
Avatar
Total Posts:  37
Joined:  2008-04-09
 

worked like a charm, thank you!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bowen
Member
 
Avatar
Total Posts:  37
Joined:  2008-04-09
 

Nobby, is there a tool similar to Firebug that could help me locate where files are that contain code?  I could solve a lot more if i just knew where to go.

Thx
Mike

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nobby
Jr. Member
 
Total Posts:  22
Joined:  2008-06-23
 

Hi Bowen,

I basically turn on the template hints in the admin section under system>configuration then select developer from the left menu (last option)

You need to select main website from the dropdown above the left menu (if you don’t then it won’t appear) and you should see Template Path Hints under Debug header, turn this on.

Go to you store page you are working on and you should see info about each file being used.

This will help you locate the files you need to edit.

I then use firebug to track down the css files.

Sorry for the late reply confused

 
Magento Community Magento Community
Magento Community
Magento Community
 
nateflint
Jr. Member
 
Total Posts:  8
Joined:  2008-08-15
 

I am new to magento and think it is swell. In response to the original post, I have found a more elegant solution to the bl2br() problem that is presented.

Overall I like the way that the product management works. Most clients will not need to enter any html wich ultimately keeps the presentation neat. I like that. However our client requires a size chart for fly rod to be placed into their description field. This caused the same problem with nl2br () creating many unwanted <br /> prior to table placement.

Removing the nl2br is an option but the client had already entered many many products.

This is the workaround:
for the description field I edited /app/design/frontend/default/default/template/catalog/product/view/description.phtml

echo nl2br($this->getProduct()->getDescription())

to this

function nl2br_skip_html($string)
{
    
// remove any carriage returns (mysql)
    
$string str_replace("\r"''$string);

    
// replace any newlines that aren't preceded by a > with a <br />
    
$string preg_replace('/(?<!>)\n/'"<br />\n"$string);

    return 
$string;
}

echo nl2br_skip_html($this->getProduct()->getDescription())
 
Magento Community Magento Community
Magento Community
Magento Community
 
nateflint
Jr. Member
 
Total Posts:  8
Joined:  2008-08-15
 

Incidentally the site is The Online Fly Shop . I would love any feedback that you might have regarding this site. Fly Fishing products present a unique strategy when it comes to organizing product.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bowen
Member
 
Avatar
Total Posts:  37
Joined:  2008-04-09
 

thanks for the reply guys, unfortunately i have months of inactivity my personal sites so it took me ahwile to get back into again!!

@ Nobby, thank you!!!  that is a great tool that was right underneath my nose...this should help me solve a few more on my own.

@nateflint, for some reason your solution did not work....Also Nobby’s solution took care of every product i have a description for.

feedback on store:
overall great looking site.  I think you have a nice balance on the homepage, i know exactly what you sell and i like the big clearance graphic front and center, people need clearance right now.

I would say the only negative is the header...it feels unbalanced and the free shipping graphic takes up most of my attention.  I would work on the header design a bit.

Thanks again for the great posts guys!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top