Search the Community
Showing results for tags 'image description'.
-
Hi I have a number of pages with images and I'm having a problem selecting on the image descriptions. In the code snippet below, the I added images.description field to my selector and it does work in that I get the expected no. of matches. So findTag gets me a list of images matching the tags in the code, but if I swap that line for the commented line $match->images->find it does not work giving 0 results. There is findTag for tags but for description there is not a dedicated function, so I should use find. But what selector will give me a list of images matched by image description? Many thanks. if($q !== '') { $keywords = $sanitizer->selectorValue($q); $matches = $pages->find("template=album, title|summary|images.tags|images.description~=$keywords"); echo "<p>match count: $matches->count</p>"; foreach($matches as $match){ echo "<p>{$match->title}</p>"; $i = $match->images->findTag($keywords); //$i = $match->images->find("template=album, images.description~=$keywords"); GIVES ZERO MATCHES $j = count($i); echo "<p>No. of image matching: $j</p>"; foreach($i as $img){ echo "<img src='{$img->url}' alt='{$img->description}'>"; } } }
- 2 replies
-
- selector string
- image tag
-
(and 2 more)
Tagged with:
-
I'm wondering if it is possible to add a label to the description input in image fields (in the admin). I'm using the module Image Extra, which has labels for each input, but I'd like to add a label to the default 'description' input too. The image below illustrates this: If there is no way (no hook?) then, I suppose I could just not use the default description and add a new description input with the Image Extra module. But I thought I'd ask in case I (or others) ever want to do this without using the module (i.e. just the one input required). I'm using PW 3.0.98 Thanks. --- FYI: yes, that is a cat and not a quilt -- this is on my local dev server and I don't have the actual photos yet! She is on a quilt, so it counts... technically.
- 6 replies
-
- images
- image field
-
(and 1 more)
Tagged with:
-
Has anyone had difficulty entering or editing image description text while on an iOS device? In my experience today the input box very occasionally accepts a tap to bring up the keyboard and cursor, but mostly behaves as if the field is uneditable. Standard text and textarea fields have been working as expected, as have text and textarea fields within repeaters. It's been a problem on a 2.5.28 and a 2.5.22 site. Nic
- 1 reply
-
- mobile
- data input
-
(and 2 more)
Tagged with:
-
Hi, I'm using the image description field on a multi-language website. I've updated recently to PW 2.5.3 and now the image description is written as an array instead of a string in the database. The issue i have is that a lot of images have a description of the kind: "description", and the new ones look something like this: {"0":null,"1052":"description"} Is there a way of going back to the old way? I mean, to get a string? How do I get the description in an array? Has anyone had the issue before? Thanks for your help.