Search found 64 matches
- Wed Jan 31, 2024 3:19 pm
- Forum: Modules/Add-Ons
- Topic: Random Images
- Replies: 3
- Views: 403
Re: Random Images
Hi Christian, This is the UDT (named "random_image") I use to display a random image from a folder: $images = glob("".$params['folder']."/*.{jpg,jpeg,png,gif}", GLOB_BRACE); $randomImage = str_replace('thumb_', '', $images[array_rand($images, 1)]); echo $randomImage; <i...
- Wed Jan 17, 2024 9:40 am
- Forum: Modules/Add-Ons
- Topic: LISE & UDT - Get previous item's id
- Replies: 7
- Views: 715
Re: LISE & UDT - Get previous item's id
Hi Jo, thank you for the feedback and clarification. I think I wasn't clear when I was explaining my requirements. The client's request is for a consecutive id which is included in the item's title (their old system names requests/items this way - I suggested a complex alphanumeric serial id but the...
- Tue Jan 16, 2024 10:01 am
- Forum: Modules/Add-Ons
- Topic: LISE & UDT - Get previous item's id
- Replies: 7
- Views: 715
Re: LISE & UDT - Get previous item's id
Hello, I've figured out a workaround for my particular issue - though I'm still open to suggestions if you have one. Instead getting the item_id from the previous LISE item (or getting the highest value of the item_id column on the db as per Jo's suggestion), I've set up my UDT to first create a new...
- Fri Jan 12, 2024 4:54 pm
- Forum: Modules/Add-Ons
- Topic: LISE & UDT - Get previous item's id
- Replies: 7
- Views: 715
Re: LISE & UDT - Get previous item's id
I've got a slight issue when an item is deleted (eg. Enquiry 4 with the item_id of 4) and then another is added. The name doesn't match the item_id (Enquiry 4 with the item_id of 5). Is there a way that instead of selecting the max value of the column that we just use the auto increment value?
- Fri Jan 12, 2024 12:05 pm
- Forum: Modules/Add-Ons
- Topic: LISE & UDT - Get previous item's id
- Replies: 7
- Views: 715
Re: LISE & UDT - Get previous item's id
Hi Jo,
That is perfect. Thank you so much! I needed to uncomment the $db but it works as expected.
Thanks again,
James
That is perfect. Thank you so much! I needed to uncomment the $db but it works as expected.
Thanks again,
James
- Fri Jan 12, 2024 10:53 am
- Forum: Modules/Add-Ons
- Topic: LISE & UDT - Get previous item's id
- Replies: 7
- Views: 715
LISE & UDT - Get previous item's id
Hi all, I'm using a UDT to save the data from an enquiry form into a LISE instance. I need to give each enquiry an item ID which needs to be consecutive. On the UDT, is there a way to load the previous LISE item's "item_id" and add to it. Here is what I have in my UDT at the moment: $data ...
- Wed Jan 10, 2024 9:21 am
- Forum: Modules/Add-Ons
- Topic: UDT Display Child Pages
- Replies: 4
- Views: 547
Re: UDT Display Child Pages
I figured out how to get the image. I've replaced the code so instead of:
I used
Then I used an if statement to display a placeholder image if its blank.
Hope this helps someone else.
Thanks,
James
Code: Select all
$image = $content->GetImage();
Code: Select all
$image = $content->GetPropertyValue('image');
Hope this helps someone else.
Thanks,
James
- Wed Jan 10, 2024 12:40 am
- Forum: Modules/Add-Ons
- Topic: UDT Display Child Pages
- Replies: 4
- Views: 547
Re: UDT Display Child Pages
Hi Jo, thanks for the feedback - I thought I'd save some time by modifying an existing UDT rather than writing from scratch. Your corrections work and the code runs if I comment out the $image line, however if I leave it as it is, the $image = $content->GetImage(); still causes a Fatal error (becaus...
- Tue Jan 09, 2024 10:00 pm
- Forum: Modules/Add-Ons
- Topic: UDT Display Child Pages
- Replies: 4
- Views: 547
UDT Display Child Pages
Hello all, I'm using pages to add Case Studies to our site. I've been trying to modify the below UDT so that the items include the page's images. I understand that I can just use the Navigator module (which is what I've done in the past) but the reason I want to keep it as a UDT is so that I can giv...
- Tue Dec 12, 2023 6:28 pm
- Forum: Modules/Add-Ons
- Topic: Navigator Sort Order
- Replies: 4
- Views: 1117
Re: Navigator Sort Order
Hi Digi,
I should've checked for replies earlier. I've just created a reverse_array modifier based on the sort_array modifier you suggested. I can confirm that |@array_reverse works without enabling permissive_smarty.
Thanks again for your help.
James
I should've checked for replies earlier. I've just created a reverse_array modifier based on the sort_array modifier you suggested. I can confirm that |@array_reverse works without enabling permissive_smarty.
Thanks again for your help.
James
- Tue Dec 12, 2023 6:05 pm
- Forum: Modules/Add-Ons
- Topic: Navigator Sort Order
- Replies: 4
- Views: 1117
Re: Navigator Sort Order
Hi Digi, Thanks for getting back to me. Navigator uses the order assigned in the backend, so the simplest option is to reorder the pages as desired (there's a drag and drop utility for doing this). I'm afraid that this can't work as there are currently 30 or so pages and there are more to be added. ...
- Tue Dec 12, 2023 5:08 pm
- Forum: Modules/Add-Ons
- Topic: Navigator Sort Order
- Replies: 4
- Views: 1117
Navigator Sort Order
Hello All, I'm using the Navigator module to show a list of child pages. I've looked at the parameters but I can't seem to find a way to sort the pages on the front end. I know that on the backend the latest added page is at the bottom of the list which is fine but I need the newest to be displayed ...
- Thu Nov 30, 2023 2:08 pm
- Forum: Modules/Add-Ons
- Topic: webp_image plugin help
- Replies: 5
- Views: 2077
Re: webp_image plugin help
The output of the tag (via fetch) is the original image URL but when the tag is used on a regular page, it returns the url of a .webp image.
- Thu Nov 30, 2023 12:38 pm
- Forum: Modules/Add-Ons
- Topic: webp_image plugin help
- Replies: 5
- Views: 2077
Re: webp_image plugin help
Hi Velden, The output of that code is the url of the page plus the query parameters: https://website.com/resources?mact=LISEResources,cntnt01,default,0&showtemplate=false Yes, when I visit the URL the plugin works which is why I'm not sure why it wouldn't work when loaded via fetch. Also, within...
- Thu Nov 30, 2023 10:32 am
- Forum: Modules/Add-Ons
- Topic: webp_image plugin help
- Replies: 5
- Views: 2077
webp_image plugin help
Hello all, We are using LISE to display resources on a page. There are a lot of resources so we ended up using javascript fetch to load the resources after the page is loaded: <__script__> document.addEventListener('DOMContentLoaded', function() { let url = '{cms_selflink page="$page_alias"...