Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-08-24 06:47:34

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Image Category Descriptions?

So I know that there are no Category descriptions, and the only way I can think of adding them is to come up with some txp trickery.

If you name the image category the same as the article category and use nested tags in the form, then I’m sure you could get something like a title, cat description and they hopefully using smd_gallery, a gallery of images.

I was just wondering if I am overlooking something and there is another way of doing this, without having to make 2 categories.

This is for my friends band site, and I don’t really want him meddling with my forms, pages or anything else actually… so it has to be on the Writer permissions level.

Is there another way?

Last edited by tye (2010-08-24 06:49:04)

Offline

#2 2010-08-24 09:18:01

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Image Category Descriptions?

Is there anything in upm_image that would help you? It’s got categorising stuff and enables image captions etc.

Offline

#3 2010-08-24 10:38:56

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Image Category Descriptions?

I did think about this myself but the solution I came up with will only work if your category names are single words. Basically, if this is the case, you can use the “name” for the category menu and capitalize it with CSS. This then leaves the category “title” free to use for a description though I suspect there is a character limit for the field. Also the “Image” tab still uses the “name” for the listing though whether that may change in the future…

If your category “names” are multiple words you have the problem of needing to remove any “-” or “_” and I’m not sure how you could go about that.

Last edited by thebombsite (2010-08-24 10:41:28)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#4 2010-08-24 10:51:01

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

Re: Image Category Descriptions?

Yeah, tough one.

Unless I’ve misinterpreted your request the only thing I can come up with is using TXP trickery too. Simplest solution I can think of is a bunch of txp:variables called catname_desc. Put them all in a single form so they’re in one place and can be added easily if more categories are defined later. Or, perhaps better still, use adi_variables and ensure the permissions are accessible to the relevant user groups?

You can then use tags-in-tags and conditional magic to display the caption if it’s defined, e.g:

<txp:category title="1" />
<txp:if_variable name='<txp:category />_desc'>
   <span class="catcap"><txp:variable name='<txp:category />_desc' /></span>
</txp:if_variable>

Twist into shape.

Last edited by Bloke (2010-08-24 10:53:47)


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

#5 2010-09-16 06:54:15

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Image Category Descriptions?

I cheated doing this… well, it actually seemed like an easier way to do things

First I created 2 categories, one image, one article with the same name.

Then I created an article and assigned it to the above category using the forms below (first for the article listing, second for the thumb layout -bog standard smd_gallery – thanks).

Simple really – and gives more control over the description output, and also output in different parts of the site.

Maybe I was just confusing myself to start with.

Whilst I was doing this though, a couple of things came up:

1 – Imagine if you could use txp tags in glz_custom_fields – for example, make a select or multi-select by using <txp:category_list type=“image” /> – then I could do without creating 2 categories (and it would be super cool) – but I am probably dreaming, I know nothing about coding :)
2 – With <txp:category_list type=“image” /> – I couldn’t figure a way to link to the categories using thumbnails – only by the category name text… well not without the use of plugins… is there a simple way to do this?

<txp:if_article_list>

<div class="gallery_item">
<txp:title />
<txp:upm_article_image type="thumbnail" limit="1" />
<txp:permlink>View all</txp:permlink>
</div>

<txp:else />

<txp:title />
<txp:body />

<txp:smd_gallery form="gallery" category='<txp:category1 />' />

</txp:if_article_list> 
<a rel="shadowbox[{category}]" href="{url}" title="{caption}"><txp:thumbnail id="{id}" /></a>

Offline

Board footer

Powered by FluxBB