Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Plugin support
  3. » smd_slimbox

#145 2007-06-07 19:42:33

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: smd_slimbox

Qwest wrote:

Top of the page, you’ll see a yellow box which displays the next event (in this case, 11th June).

Blimey, I must be psychic… the date I chose for the example I gave was for the 11th June… spooky. Anyway, I can well imagine you not wanting to name all those image categories so you’re right, IDs are much more sensible.

Try this in your form instead:

<h3><txp:permlink><txp:title /></txp:permlink></h3>
<div class="showflyers">
  <txp:smd_slimbox imageid="?flyer_front" orderby="fixed" />
</div>
<div class="showdetails">
  <h4><txp:php>echo strftime('%d %B, %G', strtotime(custom_field(array('name'=>'flyer_date'))));</txp:php></h4>
  <txp:excerpt />
</div>
<div class="showend"><txp:permlink>Permalink</txp:permlink> + <txp:comments_invite /></div>

Go into your article for 11th June and make a backup of the contents just in case, then remove the smd_slimbox code in the excerpt and put the real excerpt text in there. In your flyer_front custom field, put the following: 79, 80 and delete whatever is in flyer_back.

Save the article then look at the output. With luck, if my brain’s switched on after a hard day’s remixing, that should display slimboxable image IDs 79 and 80 within the showflyers div and the excerpt underneath, plus all the other stuff from before.

Now you don’t really need both flyer_front and flyer_back; you could rename flyer_front as flyer_images or something (change the smd_slimbox tag accordingly!), saving you a custom field. And you’re not limited to just 2 pictures either (if you’re feeling creative of course)… just list all the IDs of the pics you want to display and slimbox will do your bidding!

BTW, I notice that your images are displaying as “Image 1 of 29” etc and the next/previous links go through all the flyers on the front page in turn. You probably want this behaviour here but if not, add something like groupname="nextevent" to the smd_slimbox call and your visitors will only be able to navigate between the two at the top of the page (“Image 1 of 2”) when they click one of them.

Similarly, if they were to go to the bottom of the page and click one of the other ‘old’ event images, they would be constrained to that group only, excluding the two from the next event at the top of the page (“Image 1 of 27”). Like I say, you probably don’t want this “feature” on this site, but I thought I’d mention it in case you ever do.

Let me know if that sorts you out and if not, I’ll try and work out what you really want… been a long day in the studio.

Last edited by Bloke (2007-06-07 19:44:58)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#146 2007-06-07 19:48:57

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: smd_slimbox

jstubbs wrote:

It now works… For the record, I pressed enter, space, enter in the stm_javascript window at the end of the script.

Sweet, I guess the reason it didn’t work right away was Firefox cacheing the darn page request – it’s a bugger for that.

Note to self: mention this odd behaviour to Stanislav and ask if it’s fixable one day…


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#147 2007-06-08 09:16:51

Qwest
Member
From: London, UK
Registered: 2007-01-24
Posts: 112

Re: smd_slimbox

Bloke!! Spooky indeed, however, it’s not worked :( I removed the slimbox code from the excerpt, and replaced it with a summary, pasted the new form you listed and then changed the “flyer front” code to 79, 80. However, all it shows is the summary.. It’s as if it’s ignoring that ‘flyer_front’ field. So for the time being, i’ve had to put the slimbox code back in the excerpt field.

any ideas?

And a) thank you for the groupname="nextevent" bit, that’ll work great!!! and b) im intrigued by your ‘remixing’ lol!

Last edited by Qwest (2007-06-08 10:08:27)

Offline

#148 2007-06-08 11:00:59

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: smd_slimbox

Qwest wrote:

it’s not worked … It’s as if it’s ignoring that ‘flyer_front’ field.

Odd. I’m doing exactly that in one of my pages. My custom field is called Image_list and my tag is:

<txp:smd_slimbox imageid="?Image_list" orderby="fixed" />

Hmmmm. I have assumed since your images were called 79.jpg and 80.jpg that they were image id 79 and 80 in the database. Is that the case? The flyer_front field has to list the IDs of the images you want to show.

As a test, just force the imageids using this:

<txp:smd_slimbox imageid="79, 80" />

(or whatever the two image ids are that you want to show). If that works then at least we know it’s getting somewhere and it’s just not “reading” the custom field properly.

Next test: Are you using the keywords box? If not, try putting a single image ID in there and changing the slimbox tag to read:

<txp:smd_slimbox imageid="?keywords" />

(you can use ?article_image instead if you have an article image associated with the page). Then try putting two image IDs in your chosen field.

If it still works, then we can move back to the custom field. Move the list of image IDs from the keywords field to your chosen custom field and change the slimbox call to the name of the custom field. Make sure it’s spelled exactly the same as in your Admin->Preferences->Advanced screen (it’s case sensitive). And don’t forget the question mark at the beginning of the word!

Past that I’m stumped at the moment… I’ll have a think.

im intrigued by your ‘remixing’

Hehehe, I run a record label for free in my spare time (spare… ha!). Would love to make money/a difference doing that. We record music from talented local artists whom the record industry won’t touch because they’re “different” from the boy bands/R&B chart crud. One day it’ll take off but while we’re good at the music side, we’re rubbish at promotion. If you know any people who are awesome at marketing who will work on a profit-share basis I’m all ears :-)

The label’s Dissential – ‘scuse the site, it’s a real mess (my very first TXP effort – man if only I’d known then what I know now…)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#149 2007-06-08 11:38:51

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: smd_slimbox

Any chance of making smd_thickbox (see thickbox) now that jQuery is part of future Textpattern releases?

Offline

#150 2007-06-08 12:10:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: smd_slimbox

FireFusion wrote:

Any chance of making smd_thickbox now that jQuery is part of future Textpattern releases?

Don’t see why not. It’s not quite as pretty as slimbox and the keyboard navigation seems to be lacking, but if jQuery is going to be bundled with TXP (and wet is a big fan) I might as well dive in and get my hands dirty.

One caveat: I would probably not do it the way I did slimbox. In my overhaul of the code for v3 I’m seriously considering redisigning it as a library with bolt-on modules. Slimbox would be one such module, slideshow would be another, thickbox could be another, and anyone else could make use of the thumbnail generation code for future modules.

Now that jQuery has been decided, I’m going to approach wet and ask about ways to do this. I haven’t much idea right now; I can see how I want it to work but I can’t decide the best way to do it.

Watch this space, and thanks for highlighting that post; I might have missed it otherwise.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#151 2007-06-08 13:58:12

Qwest
Member
From: London, UK
Registered: 2007-01-24
Posts: 112

Re: smd_slimbox

Bloke! I gave your ideas a go, and it failed :( Although i think i may know why!

In all, im using 4 custom fields, flyer_front, flyer_back, flyer_date and schedule_img.

essentially, schedule_img holds the image URLs to be shown on the schedule page. Now this works with slimbox as can be seen on the schedule pages

I tried using the same code to display the same flyers from the same field on the front page and that failed, even though it’s working on another part of the site which suggests it’s not a problem with slimbox itself, more of a problem the way the site’s set up.

For my front page, and to get the ‘next event’ box to appear, i have to use the GLX_If plugin and this is what it looks like, code wise –

<txp:glx_if_frontpage> <div id="showevent"> <txp:article_custom form="nextevent" section="event" limit="1" sort="custom_1 ASC" > </div> </txp:glx_if_frontpage>

obviously, the form is what i posted earlier.

Im just curious as to why none of the ‘custom_field’ code is being used even though it works via the excerpt box?

I think a re-work of that area might be needed! Thanks for your help :)

As for Dissential, sounds very interesting indeed. I’ve dabbled with a bit of music production. Much prefer remixing though. Not sure why. And no, i dont know anyone who’s awesome at marketing.. unfortunately, i could do with someone myself actually!

Offline

#152 2007-06-08 14:23:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: smd_slimbox

Qwest wrote:

it’s working on another part of the site which suggests it’s not a problem with slimbox itself, more of a problem the way the site’s set up.

Ahhh. You just jogged my memory. Are you using the latest version 0.21b of smd_lib? There was a subtle bug in prior versions that prevented the articles using custom fields when in article list mode or made sticky.

That may explain why it’s misbehaving? I hope… or else I’m out of ideas.

btw, the latest public slimbox is v0.24

The other option is that it’s something to do with the date being in the future. Is the article itself set to a future date or are you simply posting the article “now” or in the past and using flyer_date to control when the event takes place?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#153 2007-06-08 15:28:02

Qwest
Member
From: London, UK
Registered: 2007-01-24
Posts: 112

Re: smd_slimbox

aaah.. Right.

I’ve looked in my plugin page, and i’ve got smd_lib: 0.2 and smd_slimbox: 0.22 so im presuming that it’ll need updating?!… I might just do that now!

And the article is being posted ‘now’, and using the flyer_date to control when the event appears on the site, and how it’s sorted on the schedule page..

edit: haaallaluyah!!! lol it works :) Well done ‘Bloke’! Thanks for all your help, you are a god! Just have to figure out the crazy css div problem i’ve got there now lol! Ahh, the beauty of de-bugging =\

Thanks pal!

Last edited by Qwest (2007-06-08 15:35:44)

Offline

#154 2007-06-09 17:53:15

valmeria
Member
From: France
Registered: 2005-10-22
Posts: 46

Re: smd_slimbox

Hi all, sorry if I post on the wrong thread (hope not !). I’m just trying a new install of TXP with some plugins I would like to try before using on my websites. I have a problem with running smd_slimbox :

- contents of the js folder and the css folder are uploaded to the server, assuming the textpattern root folder is mysite.com/textpattern/ and not mysite.com/texpattern/texpattern/. On my particular case, name of main folder (the first “texpattern”) is “tienda” and, by precaution, I put both folders on both folders (“tienda” and “tienda/texpattern”).

- plugin and lib are enabled

- code <txp:smd_slimbox_inc jsdir="/js" cssdir="/css" /> is on the head

- code <txp:smd_slimbox category="essai" limit="10" /> is on the article module

- CSS is on the style page

Result is here and when clicking on thumb seems that JS are not working : I just have the image on a new page, nothing more.

Due to my english, maybe I missed something on install ? Or can it be any hosting restriction ??? Thanks for help if possible.

Offline

#155 2007-06-09 18:13:22

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: smd_slimbox

valmeria wrote:

<txp:smd_slimbox_inc jsdir="/js" cssdir="/css" /> is on the head

Hi valmeria. Looking at your source it seems you are correct: your js and css are installed correctly, but the path to your js and css is not quite right. Try this instead, without the beginning ‘/’ characters so the script looks in the ‘current’ directory instead of going back to the root directory:

<txp:smd_slimbox_inc jsdir="js" cssdir="css" />

That should work. If not, can you let me know the value of your “Site URL” field please (from the Admin->Preferecnes page) and I’ll see if I can figure out why it’s not working for you.

Last edited by Bloke (2007-06-09 18:14:39)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#156 2007-06-09 18:17:36

valmeria
Member
From: France
Registered: 2005-10-22
Posts: 46

Re: smd_slimbox

Shame on me ! You’re perfectly right …. thanks for helping !

Offline

  1. Index
  2. » Plugin support
  3. » smd_slimbox

Board footer

Powered by FluxBB