Textpattern CMS support forum

You are not logged in. Register | Login | Help

#181 2008-07-29 18:59:26

michiko23
New Member
Registered: 2008-07-19
Posts: 2

Re: smd_gallery: super-flexible gallery generator

Perfect. Thanks for you help!

Offline

#182 2008-08-17 06:03:49

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,251
Website

Re: smd_gallery: super-flexible gallery generator

My gallery form looks like this
<li><img src="{thumburl}" title="{title}" alt="{title}" border="1" id="{counter}" /></li>

Is there a way to add a different class to only the first image?


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#183 2008-08-17 12:39:27

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,813
Website

Re: smd_gallery: super-flexible gallery generator

MattD wrote:

Is there a way to add a different class to only the first image?

Off the top of my head I’m not sure you can do it directly, but with some smd_if magic, yes. This is untested but something like this should work:

<li <txp:smd_if field="{counter}" operator="eq" value="1">class="active"</txp:smd_if>>
  <img src="{thumburl}" title="{title}" alt="{title}" border="1" id="img_{counter}" />
</li>

Season to taste. Note that I also made a small change to your id="{counter}" to comply with DOM naming conventions :-)

EDIT: fix closing smd_if tag according to MattD’s next post.

Last edited by Bloke (2008-08-17 17:08:45)


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

#184 2008-08-17 17:04:28

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,251
Website

Re: smd_gallery: super-flexible gallery generator

It doesn’t like that

 <img src="http://www.mydomain.com/images/36t.jpg" title="Children Portraits" alt="Children Portraits" border="1" /> ->  
Textpattern Notice: Unknown tag attribute: src  on line 605

textpattern/lib/txplib_misc.php:605 trigger_error()
textpattern/lib/txplib_misc.php(534) : eval()'d code:13 latts()
textpattern/publish.php:963 smd_if()
processtags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/lib/txplib_misc.php(534) : eval()'d code:576 parse()
textpattern/publish.php:963 smd_gallery()
processtags()
textpattern/publish.php:922 preg_replace_callback()
textpattern/publish.php:456 parse()

tag_error <txp:smd_if field="2" operator="eq" value="1">
class="active"
</smd_if>
>

My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#185 2008-08-17 17:08:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,813
Website

Re: smd_gallery: super-flexible gallery generator

*cough* the correct syntax in my post should be </txp:smd_if> not </smd_if>, sorry! I did say it was untested; just forgot to say I was a dumbass.

Last edited by Bloke (2008-08-17 17:10:15)


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

#186 2008-08-17 17:19:40

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,251
Website

Re: smd_gallery: super-flexible gallery generator

I should have spotted that. Thanks, perfect.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#187 2008-08-21 09:05:58

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 745
Website

Re: smd_gallery: super-flexible gallery generator

I’ve setup a testpage (site) for <txp:smd_gallery /> and the Slideshow thing > http://www.gunnardaan.nl/txp/

In the <head> tag:

<link rel="stylesheet" href="slideshow/css/slideshow.css" type="text/css" media="screen, projection" /> <script type="text/javascript" src="slideshow/js/mootools.js"></script> <script type="text/javascript" src="slideshow/js/slideshow.js"></script>

In the article:

<txp:smd_gallery category="daan_01" form="gallery" combo="imglist:{id}{ext}" collate="quote:{imglist}:{alt}" />

In the form:

<div class="slideshow" id="slideshow1"> <img src="<txp:site_url />images/{id#1}.jpg" alt="{alt#1}" width="{width#1}" height="{height#1}" /> </div>

The plugin is ‘active’ and everything is in place. The paths are correct. The images are there. I don’t get ‘errors’!

I need some assistance how to investigate what’s going on here … or not going on!

Last edited by RedFox (2008-08-21 09:09:32)

Offline

#188 2008-08-21 10:50:07

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,208

Re: smd_gallery: super-flexible gallery generator

Looking at the source code I find something unusual:

<script type="text/javascript">
myShow1 = new Slideshow("slideshow1",
  { hu: "http://www.gunnardaan.nl/txp/images/",
    images: [{imglist}],
    captions: [{alt}],
    classes: ["prev","next","active"],
    type: "fade"
  });
</script>

Could it be this is smd type of code, not mootools?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Online

#189 2008-08-21 11:06:33

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 745
Website

Re: smd_gallery: super-flexible gallery generator

Yes, it is of the smd type … and I’ve put it in the <head> tag … but is that correct … !?

Offline

#190 2008-08-21 15:42:28

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,203
Website

Re: smd_gallery: super-flexible gallery generator

Yeah, the curly bracket items are not getting parsed, (there should be image names, etc) which means that there’s likely a problem with your smd call or the plugin is not enabled. Also the script should go after the div with the placeholder stuff.

Post your call please.

Offline

Board footer

Powered by FluxBB