Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2009-11-21 14:55:53
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
ads/banner section
assign specific category and url’s (via alternate text field) for images on upload and display them in sidebar. basically i’d like to do a banners section. what would be the easiest way to do that? some plugin?
i hope you understood my goal.
Offline
Re: ads/banner section
Based on this txp tip
<ul><txp:smd_gallery form="category-links" category="category-images" /></ul>
and the form
<li><a rel="section" href="<txp:site_url />category/{name}/"><img src="<txp:site_url />images/{imagedef}" title="{caption}" alt="{alt}" thumb="1" /></a></li>
where:
- {name} is the name of the image and it should be equal to the category name
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#3 2009-11-23 13:52:28
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
Re: ads/banner section
i’m afraid you get me wrong, but, smd_gallery suits for that, i think
Offline
Re: ads/banner section
Hi Gallex, sorry if I misinterpreted but if my response helped in some way I’m glad for that:)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#5 2009-11-24 08:09:03
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
Re: ads/banner section
Gallex wrote:
but, smd_gallery suits for that, i think
p….or maybe not. unfortunally it doesn’t support using alternate text fields as a website urls like rah_aimage for example does.
my wish is to make it very simple for a client. he uploads image, chooses correct category (banners for example), inserts into alternate text field the website url there this image should link to, clicks save and that’s it. the code outputs all those images assigned to banners category somewhere in a page.
is it achievable?
Offline
Re: ads/banner section
Gallex wrote:
it doesn’t support using alternate text fields as a website urls like rah_aimage for example does.
Yes it does. You can use the fields for whatever purpose you like. For example, if you tell your client that they should type the destination url in the ‘alt’ field then you can do this as your (very simple) gallery:
<txp:smd_gallery category="banners">
<a href="{alt}"><txp:image id="{id}" /></a>
</txp:smd_gallery>
EDIT: Put slash in the right place, d’oh!
Last edited by Bloke (2009-11-24 11:19:37)
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
Re: ads/banner section
Why it s not possible?
taking colak code:
<ul><txp:smd_gallery form="category-links" category="banner" limit="1" /></ul>
and create category-link form like that:
<li><a rel="section" href="{title}"><img src="<txp:site_url />images/{imagedef}" title="{caption}" alt="{alt}" thumb="1" /></a></li>
Assuming that the url of the website is put into title image field
Not tested but should work
A+
PS: Blok faster ;)-
Last edited by Dragondz (2009-11-24 09:36:39)
Offline
#8 2009-11-24 10:34:20
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
Re: ads/banner section
Bloke wrote:
<txp:smd_gallery category="banners">
<a href="{alt}"><txp:image id="{id}" /></a>
<txp:/smd_gallery>
and that’s it, nothing more?
putted your code above into form smd_gallery and this: <txp:output_form form="smd_gallery" />
into page, but nothing happens. the plugin is active and smd_lib is installed…
Offline
Re: ads/banner section
Gallex wrote:
putted your code above into form smd_gallery and this: @<txp:output_form form=“smd_gallery” />
I should have added it was untested. And perhaps you should put the trailing slash on the smd_gallery tag in the right place that I *cough* did wrong. I’ll update the post above to fix it. But in theory yes, that’s the sort of thing that’s required to do it. Mix ‘n’ match with what colak and dragondz have already posted.
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
#10 2009-11-24 11:31:54
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
Re: ads/banner section
perfect! thanks
Offline
Pages: 1