Topic: Gallery Index does not use Caption HTML Formatting with Gallery Titles

Hello,

i am using latest SvManager with latest SimpleViewer Pro Gallery.
Because of long Gallery Titles (SvManager, customize, basic, gallerytitle) i want to use <br /> for new lines... that is working fine when looking in a single gallery (thumb oversight), but not in the oversight of all available galleries (the page you can see when you visit the svmanager directory without specifying a file. Looks like the HTML-Tags are getting stripped.

Example:

Gallerytitle in SvManager: "Exhibition at Museum,<br />from 2012/11 till 2013/04<br />Great Opening"
is saved to gallery.xml: "Exhibition at Museum,&lt;br /&gt;from 2012/11 till 2013/04&lt;br /&gt;Great Opening"
opening the gallery itself the caption is displayed correctly over three lines.

But at the oversight of all gallerys the title is displayed like here: "Exhibition at Museum,from 2012/11 till 2013/04Great Opening"... one single line, which is not so beautiful to look at wink

Any short way to fix that ?

Last edited by Reaper (2012-01-18 20:10:49)

Re: Gallery Index does not use Caption HTML Formatting with Gallery Titles

It would help to see your actual page but I tried to visit the url you gave and it didn't work for me.

Looks like the HTML-Tags are getting stripped.

Yes they are.

one single line, which is not so beautiful to look at

I can think of three ways to improve the single line (starting with the simplest):

  1. Add a space after your <br /> tags

  2. Add a space and set a css width on the paragraphs that contain the title. This will not give you full control over the breaks but it's fairly easy and it might improve things.

  3. Edit the svManager code so the break tags are no longer stripped out. I don't usually recommend hacking the svmanager code but this one is not too difficult or dangerous if you want to have a go.

So if you'd like to try Option 2 (css) or Option 3 (code hack) and you'd like some help then post back here and I'll provide some instructions.

jack

Jack Hardie
SimpleViewer Support Team.

Re: Gallery Index does not use Caption HTML Formatting with Gallery Titles

I took the third way, and replaced line 100 in classes/indexpage.php

$title = htmlspecialchars(strip_tags($galleriesData[$key]['title']), ENT_QUOTES, 'UTF-8');

with:

$title = $galleriesData[$key]['title'];

That works wink

Thanks for your help.

Last edited by Reaper (2012-01-18 20:27:50)

Re: Gallery Index does not use Caption HTML Formatting with Gallery Titles

Good – that's what I would have done.

It will probably be a good idea not to put special characters like & > " ' in your gallery titles since they will now be passed through to the index page. Most browsers will probably handle them ok but it's difficult to be sure.

Incidentally, it should be possible just to allow break tags through and filter out all the other tags by a small modification to your code.

$title = strip_tags($galleriesData[$key]['title'], '<br>');

Note that there is no space and no slash inside the '<br>' but there must be a space before the slash in your title tags – like you have them now. I haven't tried it but it should work. See the php docs for more information.

jack

Jack Hardie
SimpleViewer Support Team.