Welcome, Guest. Please login or register.
Did you miss your activation email?
04 Jul 2009, 00:04

Login with username, password and session length
Home Chat Help Search Calendar Login Register
Pages: [1]
Print
Author Topic: How to use author-selected images in a template?  (Read 1151 times)
0 Members and 1 Guest are viewing this topic.
LimeJuice
Guest
« on: 24 Aug 2006, 06:58 »

Hi

Firstly, please accept my apologies if the answer to this question is well-known or seems obvious.  I'm new to CMSMS and I'm a bit stuck...

I'm aware that templates can include multiple content blocks, each with its own name, by using the {content} tag.  When an author creates or edits a page based on that template, they see separate editor areas ('slots'), one for each content block.  But, these content blocks are all for textual, HTML-like content.

* How can I specify a content block that's just for an image?

I want the author to be presented with a 'slot' which, instead of being an htmlarea or wysiwyg editor, is an image chooser.  Then, they can type in the name of their selected image for that 'slot' in the template, or even (as a luxury) browse the CMS's uploaded images to select one.

For templating reasons, this 'slot' needs to specify *just a path to an image* (e.g. for use in the 'src' attribute of an 'img' element) - not a piece of text or HTML.  Is there a tag for this purpose?  The {image} tag seems to be only for fixed images chosen at template-design time - or have I misunderstood it?

Similarly, is there I tag I can use for other non-textual assets that need to be specified by on a page-by-page basis by page authors, but handled specially by the template?  I'm thinking of multimedia files like SWFs, PDFs, MP3s or whatever?

Many thanks in advance for your help,

Richard Smiley

Logged
mark
Administrator
Power Poster
*****

Karma: 131
Offline Offline

Posts: 6566

Location: Arizona



WWW
« Reply #1 on: 24 Aug 2006, 13:19 »

I tried this using this in the template of course they will have to know the name of the image including the type eg,. .jpg or .gif unless you put it at the end then they will only be able to put that kind of image in it...

1.)<img src="http://thedomainname.com/uploads/images/{content block='*for images only' oneline='true'}">

for resticting it to a certain type and just the name of the image like 'header' which like I said will have to have a .jpg on the end of it...

2.)<img src="http://thedomainname.com/uploads/images/{content block='*for images only' oneline='true'}.jpg">

This *for images only shows up as *for Images Only: with a small box here.

In the box they need to put...
 in line
 1.) book.gif/.jpg
 in line
 2.) book 

This may be able to handle additional types of input such as mp3s * not tested *, I've tested the image part, it works.
Logged

Go to Extensions Modules/Tags click the name of the module/tag or the word Help to the right to get the parameters it takes...
Right click and view source is a great way to see what you have to work with...
Not sure what ver. CMSMS, PHP, server OS, etc. look at the System Information page...
OK if you removed the default content read it here... http://multiintech.com/defaultcontent/
People are Wonderful... Business is Great... Life is Terrific
LimeJuice
Guest
« Reply #2 on: 25 Aug 2006, 09:30 »

Thanks Mark, that's a really good suggestion.  It should suffice as a workaround until "proper" image-type content blocks are available.

Cheers!   Smiley
Logged
WebGirl
Forum Members
**

Karma: 3
Offline Offline

Posts: 187



« Reply #3 on: 21 Oct 2006, 03:10 »

Hi there,

I had no idea how to do this either, so I just created a new {content} block called {content block="Image for top of page" }, so the website owner could add a different image at the top of each new page.

This works fine, except that the physical size of the block for {content block="Image for top of page" } is huge.

Question 1 : is there any way to alter the SIZE of the block which appears?

I set up a third block to show the new NAME of the page as well, and also ended up with a huge block on the edit screen {content block="Page name to right of image" }.

Question 2 : is there a better way to do this, or is what I've done ok?

My only concern is that the website owner will be presented with 3 huge text blocks - and yes, I am giving them a written manual with lots of snapshots to make it easy, I just thought aesthetically it would be nice to make the 'input' screen a bit 'tidier'.

Cheers
WebGirl
Logged

KoalaBlue
Forum Members
**

Karma: 1
Offline Offline

Posts: 37


« Reply #4 on: 23 Oct 2006, 18:44 »

About the additional content areas, I read elsewhere on the forum where you can do this

 <h2>{content block="thirdblocktitle" oneline="true" wysiwyg="false"}</h2>

'oneline' means don't show a whole Content Block on the screen, just one line to fill in.

wysiwyg 'false' means no need to show the FCKeditor - you can do all your styling in the stylesheet and template.
Logged
KoalaBlue
Forum Members
**

Karma: 1
Offline Offline

Posts: 37


« Reply #5 on: 23 Oct 2006, 19:26 »

Mark - I just used your suggestion in a piece of javascript, and it worked!  fantastic, mate!

Quote
2.)<img src="http://thedomainname.com/uploads/images/{content block='*for images only' oneline='true'}.jpg">
Logged
Pages: [1]
Print
Jump to: