Forums » Customize

Divide Exhibit Into Sections 'Mod'

  • Pages:
  • 1
  • 2
richardn
UNITED KINGDOM
2010-02-14 20:06:39
Permalink Post
 

Hmm - can't get these code tags to work. I'll try again. (Delete the spaces after the '

richardn
UNITED KINGDOM
2010-02-14 20:08:08
Permalink Post
 

Grrrr

Hmm - can't get these code tags to work. I'll try again. (Delete the spaces after the '< ' signs.)

2a. Change lines 507-510 to:

(507) $body .= "< label>Image Title";
(508) $body .= "< textarea name='media_title' id='media_title'>" . $rs['media_title'] . "";
(509) $body .= "< label>Image Caption";
(510) $body .= "< textarea name='media_caption' id='media_caption'>" . $rs['media_caption'] . "";

2b. Change lines 47 and 48 to:

(47) var title = encodeURIComponent( $('#media_title').val() );
(48) var caption = encodeURIComponent( $('#media_caption').val() );

2c. Add these two lines to the end of the CSS file:

textarea#media_title { width: 500px; height: 100px; }
textarea#media_caption { width: 500px; height: 100px; }

That's it.

Let me know if it works for you.

R

richardn
UNITED KINGDOM
2010-02-15 14:45:46
Permalink Post
 

One last adjustment.

From line 256 of files.php in /ndxz-studio/module/exhibits delete:

title='$img[media_title]'

(As discussed in this thread)

richardn
UNITED KINGDOM
2010-02-15 14:56:11
Permalink Post
 

Sorry, I formatted 2a above incorrectly, and missed the closing textarea tags. This is it - lines 507-510. (Delete the spaces after the '< ' signs):

$body .= "< label>Image Title";
$body .= "< textarea name='media_title' id='media_title'>" . $rs['media_title'] . "< /textarea>";
$body .= "< label>Image Caption";
$body .= "< textarea name='media_caption' id='media_caption'>" . $rs['media_caption'] . "< /textarea>";

richardn
UNITED KINGDOM
2010-02-15 14:58:29
Permalink Post
 

God, I'm an idiot. One more try, with added spaces:

$body .= "< label>Image Title< /label>";
$body .= "< textarea name='media_title' id='media_title'>" . $rs['media_title'] . "< /textarea>";
$body .= "< label>Image Caption< /label>";
$body .= "< textarea name='media_caption' id='media_caption'>" . $rs['media_caption'] . "< /textarea>";

IgraQ
CZECH REPUBLIC
2010-03-08 23:21:32
Permalink Post
 

Leslie: Thank You so much for this useful tip!

Julischki
GERMANY
2010-04-04 17:44:47
Permalink Post
 

Leslies Hack works perfectly - thanks so much - but my dropdown menue doesnt work any longer. Any ideas?

yomama
UNITED STATES
2010-04-09 06:17:05
Permalink Post
 

For those of you who want the line breaks in the media_caption form field to wrap to a new line (aka hitting return in the form field will add a break tag) do this...

In the ndxz.exhibit-edit.js file (ndxz-studio > asset > js folder) around line 47 (I've added code so this is referencing the line numbers in the posts above) add

  1. function return2br(dataStr) {
  2.         return dataStr.replace(/(r|n)/g, "
  3. ");
  4. }
  1. above function updateImage(ida)
  1. then change var caption = encodeURIComponent( $('textarea#media_caption').val() ); */
  1. to var caption = return2br( $('textarea#media_caption').val() );
  1. so the two functions should look like this…
  2. function return2br(dataStr) {
  3.         return dataStr.replace(/(r|n)/g, "
  4. ");
  5. }

function updateImage(ida)
{
    var title = encodeURIComponent( $('textarea#media_title').val() );
    var caption = return2br( $('textarea#media_caption').val() );
    
    $.post('?a='+action, { upd_jximg : 'true', v : title, x : caption, id : ida },
        function(html) {
            //updating(html);
            getExhibit();
    });
}

Now your lines should wrap in your image caption the same way they do in the edit page text field :)

yomama
UNITED STATES
2010-04-09 06:19:29
Permalink Post
 

Hmm, the code tags got away from me there. Just read through the above and ignore the formatting. :)

marwan
SPAIN
2010-05-29 12:07:23
Permalink Post
 

hello, great thread !
is anybody getting problems with the thickbox plugin and this hack ?
thks

marwan
SPAIN
2010-05-29 12:18:21
Permalink Post
 

ok forget about it
got it to work

donna
UNITED STATES
2010-06-05 03:40:55
Permalink Post
 

uh oh
I followed the directions from the top and I'm getting the "null" as well --
I'm not super super adept at these things so should I just try to reverse the damage - switch everything back?
I'm using slideshow format fyi
-any help would be appreciated -
-scared to go the difficult-seeming richardn route

donna
UNITED STATES
2010-06-05 03:48:12
Permalink Post
 

I should add that I tried southafrica's solution and that didn't work either-

momper
GERMANY
2010-06-17 06:46:17
Permalink Post
 

@yomama

i don't bring it to work combined with the stuff of richardn - can you paste it again in a clean formatting form - that would be nice :) - maybe this is only the problem ...

thanks momper

momper
GERMANY
2010-06-17 09:34:48
Permalink Post
 

ok as a fast fix:     

  1. $title = ($go['media_title'] == '') ? '' :  nl2br($go['media_title']) . ' ';
  2. $caption = ($go['media_caption'] == '') ? ' ' : nl2br($go['media_caption']);
wadoli
SWITZERLAND
2010-07-21 13:09:06
Permalink Post
 

I just successfully implemented the changes put forward in LeslieOA's original post (thank you). What fixed the «null»-entry in the caption-field for me was to delete the browser-cache. So here is my advice to everyone that gets the «null»-error: delete your cache (Firefox: Clear Recent History) right after doing the changes and before logging into you indexhibit-installation again. That solved it for me.

Showing 26 - 41 of 66 posts in Forum > Customize > Divide Exhibit Into Sections 'Mod'
 
  • Pages:
  • 1
  • 2

You need to be logged in to post.