Jump to content

Image with multi-language fields: repeater or else?


Gabi
 Share

Recommended Posts

Good day, gentlemen!

I'm trying to make a slideshow based on tags like this:

1. the slideshow is a Page field that gets the tags; I check the checkboxes for the tags I want to show as slide, giving me a tags list (PageArray)

2. a list containing all the portfolio pages that have tags in the list from 1 is generated

3. a list of images that have tags in the list from 1 and are contained in the portfolio pages in the list from 2 is generated

4. get a certain number of random images in the list from 3

5. output as one slide

This introduction was made just to set a context. The question comes now: I want my images to have alt and tags fields. Multi-lingual alt and tags fields, that is. If it was not for a multi-lingual site, I could use the Description and Tags fields for that. But it is.

So I made a Repeater with an single Image field (no tags, no description) and two multi-lingual fields. It feels a bit clunky to me. Is there a better solution?

Thank you.

Link to comment
Share on other sites

Man, I'm stupid!

Tags already have multi-lingual fields. My mistake was that I didn't connect images to the tags - i.e. my mind was considering image tags being different from the page tags. Don't ask me why, I don't know!

This forum is different! I ask a question and the answer comes directly into my brain! :lol:

LATER EDIT: the Alt field is still a TextLanguage field attached to the Repeater. Is there a better option?

LATER LATER EDIT: it seems like a PageAutocomplete field doesn't work inside a Repeater? Is that right?

Right now, I'm back at square 1 (not 0, mind you, I still have my Alt multi-lingual field). But how do I connect images with tags Pages?

Hmm, doesn't seem like a multi-lingual question anymore.

Link to comment
Share on other sites

I'm running 2.3 stable.

So, a PageAutocomplete doesn't work in a Repeater, but an AsmSelect does. I like the natural way of entering items in a PageAutocomplete, but I also like that you can see all existing Pages in an AsmSelect. If both would've worked I would've been forced to choose :lol:. I think I'll stay with this version...

So, I have now a Repeater with an single Image field - no tags, no description -, a TextLanguage field for the HTML alt attribute and a Page field with AsmSelect input for tags. And I can always add more fields if needed.

My only discomfort is because of the interface - I think the admin style puts too much weight on the labels.

Link to comment
Share on other sites

So, a PageAutocomplete doesn't work in a Repeater, but an AsmSelect does. I like the natural way of entering items in a PageAutocomplete, but I also like that you can see all existing Pages in an AsmSelect. If both would've worked I would've been forced to choose  :lol:. I think I'll stay with this version...

I haven't actually tried an autocomplete in a repeater yet, but theoretically it should work. However, you may need to switch to the dev branch, since that contains an update that enabled autocomplete fields to work in tabs (which I'm hoping means they also work in repeaters). Let me know if you find it still doesn't work. 

Link to comment
Share on other sites

Hmm, I must confess that the PageAutocomplete was in a Repeater that was in a tab :-[.

But I'm happy to report that in the dev branch the PageAutocomplete does work in a Repeater which is in a tab.

I just realized that I like more to see all the already defined tags, so I'm keeping the AsmSelect. When time and brain allows, I'll try to see if I can cobble together a Page input field like the tags field from MODx 2.x.

Also I'm happy to report that my slideshow is coming up nicely. Thank you all!

Oh, and I absolutely love the way ProcessWire makes whatever I want it to do. Ryan, you should embed The Three Laws of Robotics in ProcessWire before it's too late!

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...