Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2006-03-15 13:49:14

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Improving TXP Image Management

ahh, yeah, I get it.
That’s a great feature.
I hadn’t really used that in upm_img_popper tags much, but I see how that could work nicely. It would be nice to be able to specify one dimension and require the other to follow proportionately. Maybe that can be accomplished via the keyword idea you spoke of above?

Hmm. Now you’ve got me thinking.


Offline

#62 2006-03-15 16:08:26

Bastian
Plugin Author
From: Wuppertal, Germany
Registered: 2005-02-02
Posts: 376
Website

Re: Improving TXP Image Management

Some days ago:

I would suggest:
I merge my work to an plugin, that handles that AJAX-Tab loading and then we see how to go on.

I finished a very basic plugin, which handles AJAX-Tabs. The tabs only contain text.

Download

I tested it wich Firefox 1.5 and IE 6.0, hope it works for you to.

While i have no help included, where a short description

It adds some lines of XHTML to the write screen:<pre><code> &lt;p>&lt;a href=”#” onclick=“toggleDisplayAndLoad(‘bas_img_wizard’,‘selector’);”>Image Wizard&lt;/a>&lt;/p> &lt;div id=‘bas_img_wizard’ style=‘display:none’>&lt;div class=‘wrap’>&lt;div class=‘inner-wrap’> &lt;ul id=‘navi’> &lt;li id=‘nav-selector’ class=‘down’>&lt;a href=‘javascript:swapScreen(“selector”)’>Selector&lt;/a>&lt;/li> &lt;li id=‘nav-styler’ class=‘down’>&lt;a href=‘javascript:swapScreen(“styler”)’>Styler&lt;/a>&lt;/li> &lt;li id=‘nav-upload’ class=‘down’>&lt;a href=‘javascript:swapScreen(“upload”)’>Upload&lt;/a>&lt;/li> &lt;/ul> &lt;div id=’<b>bas_img_wizard_content</b>’>&lt;/div> &lt;img src=‘http://samisdat.org/images/84.gif’ id=‘loading’> &lt;/div>&lt;/div>&lt;/div> </code></pre>

Thats is all code which is loaded on client-side on start, the content is loaded by AJAX after a click on Image Wizard link.

If you have a look to plugin’s code, you see that every tab’s content is delivered by a seperate function . The tabs are loaded by the JS function swapScreen:
<code>&lt;a href=‘javascript:swapScreen(“tab”,“vars”)’></code>

tab defines the tab to load and vars are passed to the php tab function.

Please try it and give me some feedback.

Offline

#63 2006-03-15 16:28:04

maarten
Member
From: Netherlands
Registered: 2005-02-19
Posts: 130
Website

Re: Improving TXP Image Management

Looks promising! It interferes with the bas image selector but you wouldn’t use both anyway.

Offline

#64 2006-03-15 18:24:51

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Improving TXP Image Management

Patrick,
Per this post above, perhaps enabling percentage as an option for width and height?

Bastian,
I’ll check out your plugin tonight! :)


Offline

#65 2006-03-15 21:17:43

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

Re: Improving TXP Image Management

@hakjoon:

>>As well as title=, which tends to just display on hover, the ability to display a (stylable) caption for each image if required, probably from the text in the title= field
>It seems that this should be doable with CSS and Javascript without it being hardwired in the image tag.

True true, evidently I hadn’t thought it through properly last night. ‘Twas late.

I already use the JS/CSS idea on my (currently non-txp) website link over there <— The body triggers an onload which scans the page for img title= tags, creates a new DOM node containing the text and applies a style: CSS takes over from there. It works but there’s a slight delay if the image loads before the page has finished loading, the page is then scanned and the caption created. On slow connections (and if the image was floated) you’d notice the image appear, then the surrounding content would shift out of the way after the caption was added to the DOM structure.

In an ideal world, (X)HTML would support an img caption= attribute like the table tag has (please tell me if it does and I’ve missed it or if there’s a better way than the JS kludge). I just thought that if the txp:image tag was potentially being revamped then an ideal time to create a stylable caption would be by having an attribute caption=“1” or something in the tag itself. Then, instead of displaying the img tag thus:

<img src="blah.jpg" alt="alt_text" title="title_text" />

it could output summat like:

<img src="blah.jpg" alt="alt_text" /><div class="img_caption">title_text</div>

The downside is it would add a whole slew of attributes like caption_style/caption_wraptag etc and it might not be worth it. :shrug: was just an idea. If it has legs, great, if it doesn’t there’s always JS.

>>Support for reading the additional meta/EXIF data/file size/assigned category (or category tree)
>Do you mean reading the exif data on upload/import or using that data when displaying the images?

I envisaged the latter. So, for a photoblog you could maybe offer a nice collapsible “details” link that showed info like camera/ISO/shutter speed for interested geek… sorry, parties :op

The first idea gives nice scope for txp:related_images though, e.g. “hey, I like this picture: show me other images taken with a shutter speed less than 500ms.” Or is that pushing it a bit?!

@ma_smith/hakjoon: like the idea of the 3rd/4th/5th… image size. I’m currently using a thumb for article_lists, a medium size picture for article_images (showing details about the pic) and a full-size available for download. That means keeping track of at least 2 images that differ in only their dimensions. Doesn’t help if I want to offer downloadable desktop images at 1600×1200, 1280×1024, 1152×864 etc as well but that’s my cross to bear :-)

@Bastian: if I get a chance I’ll try your plugin out later on. Nice work.

Last edited by Bloke (2006-03-15 21:22:28)


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

#66 2006-03-15 21:31:40

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Improving TXP Image Management

Bloke wrote:
I just thought that if the txp:image tag was potentially being revamped then an ideal time to create a stylable caption would be by having an attribute caption=“1” or something in the tag itself. Then, instead of displaying the img tag thus:

<img src="blah.jpg" alt="alt_text" title="title_text" />

it could output summat like:

<img src="blah.jpg" alt="alt_text" /><div class="img_caption">title_text</div>

The downside is it would add a whole slew of attributes like caption_style/caption_wraptag etc and it might not be worth it. :shrug: was just an idea. If it has legs, great, if it doesn’t there’s always JS.

that kind of the beauty of having it all be configurable via an output form. You could just have <txp:image> use a form like

<img src="<txp:img_url>" alt="<txp:img_alt>" /><div class="img_caption"><txp:img_caption>/<txp:img_title></div>

This actually opens up all sorts of possibilities without having to have a bunch of attributes for special cases.


Shoving is the answer – pusher robot

Offline

#67 2006-03-15 22:45:33

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

Re: Improving TXP Image Management

hakjoon wrote:

that kind of the beauty of having it all be configurable via an output form. You could just have <txp:image> use a form like
<img src="<txp:img_url>" alt="<txp:img_alt>" /><div class="img_caption"><txp:img_caption>/<txp:img_title></div>

D’oh! Of course… genius! I’m with you on that 100% now the bulb has finally come on. You can tell I’ve only been using txp a month or two. Still not shaken the ol’ coding mindset.

I’ll crawl back in my box now…


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

#68 2006-03-15 22:57:03

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Improving TXP Image Management

Bloke,
I know that box only too well. You’re not alone bro.


Offline

#69 2006-03-15 23:20:14

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

Re: Improving TXP Image Management

:briefly poking head out of his box again:

@Bastian: just ran your plugin. Sweeeeeeet. Can see awesome potential in that for image handling, and ultimately the same sort of framework for managing files/links. Keeps everything nice and contained and I like the fact it’s kind of “modal” : there’s no chance that li’l box will get ‘lost’ behind the main browser window like a standard popup would, which aids usability (1:click image link; 2:play in new box; 3:finish playing and dismiss box; 4:instantly back to article). Smart, clean and intuitive for both noobs and veterans alike, imho. Excellent job.

Ran fine in Firefox 1.5.0.1 and Opera 8.53 (build 7722) on win32.

:the box beckoneth once more:


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

#70 2006-03-16 23:45:02

Bastian
Plugin Author
From: Wuppertal, Germany
Registered: 2005-02-02
Posts: 376
Website

Re: Improving TXP Image Management

@maarten and Bloke: Thanks for testing

Next step would be to fill the tabs.

BTW: Is anybody working already on <img src="<txp:img_url>" alt="<txp:img_alt>" />?

I have something similar for my new page
I am using for example <txp:bas_image cat='a-cat' form='image-in-excerpt' />
Fetching all images form a-cat and parse them with image-in-excerpt. That form could contain:

<a href="<txp:bas_img_url />" title="Click to enlarge">
<img src="<txp:bas_thumb_url />" alt="<txp:bas_img_alt />" title="<txp:bas_img_name />" />
</a>

And it will output all thumbs from c-cat linked to enlarge.

Anyone interested or is that work done already?

Offline

#71 2006-03-17 01:28:04

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Improving TXP Image Management

Work’s not done yet. Some of it is in <upm_image> that comes with upm_img_popper That was more of an ideal example. Although except for the fetching everything in a category part this functionality is in <upm_image> already.

The stuff I outlined in the wiki was sort where I saw the logical progression of what Mary bstarted going. Looks like you had some of the same ideas.

BTW your plugin shell looks awesome. I’d love to help flesh it out.

Last edited by hakjoon (2006-03-17 02:24:52)


Shoving is the answer – pusher robot

Offline

#72 2006-03-17 08:40:10

Skubidu
Archived Plugin Author
Registered: 2004-10-23
Posts: 611
Website

Re: Improving TXP Image Management

Bastian schrieb:

I finished a very basic plugin, which handles AJAX-Tabs. The tabs only contain text.

@Bastian: I tested your plugin and I think it’s much better than any pop up window. I just don’t like the way the wizard is positioned and overlaping the write tab. Wouldn’t it be an good idea to open this new window the “lightbox way”? Overlaying the interface with a fading grey so that the user knows, that there is some kind of new windows where he has to do some actions. It look a little bit confusing to me the way it is now.

edit: For those who don’t know it yet – the lightbox way

Last edited by Skubidu (2006-03-17 08:48:14)

Offline

Board footer

Powered by FluxBB