Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-04-20 09:30:17

almacmillan
New Member
From: Scotland
Registered: 2008-04-12
Posts: 9
Website

Image control including resizing & links - a question

Hi there,

I have a question. I am working on a job for a client. They want to have the ability to control some images from the cms (textpattern obviosly) that appear in a footer. They are ads really. So I am looking for a simple way for them to control:

1) which images are showing
2) easily add the image links to the advertiser’s websites
3) some kind of re-sizing of the images to the height required to not break the page design.

I am trawling through plugins but it all seems too complicated somehow. Has anyone got any ideas how this could be done in the least complicated way for the user.

Kind regards
AL

Offline

#2 2008-04-20 09:46:58

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: Image control including resizing & links - a question

almacmillan wrote:

1) which images are showing

You could use custom fields

2) easily add the image links to the advertiser’s websites

see above

sample code

<txp:if_custom_field name="url"><a href="<txp:custom_field name="url" />"><txp:asy_wondertag><txp:image id="<txp:custom_field name="image" />"></txp:asy_wondertag></a></txp:if_custom_field>

3) some kind of re-sizing of the images to the height required to not break the page design.

glx_admin_image

Edited to add asy_wondertag

Last edited by colak (2008-04-20 16:02:29)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Online

#3 2008-04-20 11:09:44

almacmillan
New Member
From: Scotland
Registered: 2008-04-12
Posts: 9
Website

Re: Image control including resizing & links - a question

My brain is melting trying to understand this!

Offline

#4 2008-04-20 12:23:46

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: Image control including resizing & links - a question

Ok:)

The breakdown

<txp:if_custom_field name="url"> – you can name the custom fields in Admin>Preferences>Advanced
<a href="<txp:custom_field name="url" />"> – where your client will insert the url the banner is linked to
<txp:asy_wondertag> – Assists in the use of a tag within a tag
<txp:image id="<txp:custom_field name="image" />"> – where your client will insert the id of the banner in the custom field named image
</txp:asy_wondertag></a></txp:if_custom_field> – close tags

Last edited by colak (2008-04-20 12:25:09)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Online

#5 2008-04-20 12:56:03

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Image control including resizing & links - a question

A fairly simple method to make sure images won’t exceed certain dimensions is to place them inside a div set to a specific pixel size and overflow set to “hidden”.

Then you can scale the image to fill the width or height by using a value of 100% for either attribute, but not both. That will scale it proportionally.

Of course this is no replacement for proper resizing and cropping, but it adds an extra layer of protection.

Offline

#6 2008-04-20 13:27:12

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Image control including resizing & links - a question

masa wrote:

Then you can scale the image to fill the width or height by using a value of 100% for either attribute, but not both.

With out that 100% or exact size, ya can just prevent the image from breakin’ the layout as the overflow: hidden; hides the overcom’ part of the image. Also, min-height and max-width, and so-on, compinations can help, thus’em won’t work with older browsers like our beloved oldy IE6.

Offline

#7 2008-04-20 15:33:44

almacmillan
New Member
From: Scotland
Registered: 2008-04-12
Posts: 9
Website

Re: Image control including resizing & links - a question

Thanks for everyone who has posted so far. It’s my first project with Textpattern and that was my first support post and I am delighted by the thoroughness and speed with which I’ve been helped. I am just trying to get this working now..

Offline

Board footer

Powered by FluxBB