You are here:  » add page breaks


add page breaks

Submitted by shaunmac on Fri, 2013-02-15 15:22 in

I am looking to find a way I can add page breaks or returns on one of my data fields (Product Description) so I can have paragraphs instead of continues text. Please too link below to see what I mean. I need the text starting with .INDOOR:- Yield: to have a break after it and so on. I have it this way in my csv but it does not transfer to the site.
{link saved}

Submitted by support on Fri, 2013-02-15 15:52

Hi Shaun,

A new filter that applies PHP's nl2br() function will correct this for you. To add the new filter, add the following code to your includes/filter.php, just before the closing PHP tag:

  /*************************************************/
  /* nl2br */
  /*************************************************/
  $filter_names["nl2br"] = "nl2br";
  function filter_nl2brConfigure($filter_data)
  {
    print "<p>There are no additional configuration parameters for this filter.</p>";
  }
  function filter_nl2brValidate($filter_data)
  {
  }
  function filter_nl2brExec($filter_data,$text)
  {
    return nl2br($text);
  }

With that in place, add a new nl2br filter to the description field for the feed containing descriptions with line breaks, and then re-import - that should do the trick!

Cheers,
David.
--
PriceTapestry.com

Submitted by shaunmac on Sat, 2013-02-16 15:36

not sure if I'm not doing this right but I added the code from above to my filters file added the filter then re-imported and it does not seem to do anything.

Submitted by support on Sat, 2013-02-16 16:47

Hi Shaun,

Please could you let me know the URL of the installation and the filename of the feed containing the new line breaks that are not making it to the product page (I'll remove before publishing your reply) and I'll take a look at the feed directly and see how the line break is encoded...

Thanks,
David.
--
PriceTapestry.com

Submitted by shaunmac on Mon, 2013-02-18 13:52

my price tapestry install is at {link saved} and my feed is {link saved}

Submitted by support on Mon, 2013-02-18 14:37

Thanks Shaun,

I'll follow up by email...

Cheers,
David.
--
PriceTapestry.com

Submitted by shaunmac on Mon, 2013-02-18 15:33

it worked thank you so much for your help