1. davidcraiguk
  2. RO CSVI
  3. Sunday, 07 April 2024
  4.  Subscribe via email
I'm trying to split the j2store main_image field to get the bit to the left of the '#' using Rules and the multireplace plugin.

The j2store 'main_image' field contains "images/products/t-shirts/carnivore/military-green-1000x1000_Bull_coloured_-_I_also_like_Cake-orange-text-f0a253\.jpg#joomlaImage://local-images/products/t-shirts/carnivore/military-green-1000x1000_Bull_coloured_-_I_also_like_Cake-orange-text-f0a253\.jpg\?width=1000&height=1000"

first I escaped the '.' and the '?' using a text based Find and Replace - that worked. Then I added another line to the Rule,

Then I applied a regex Find and Replace using' /^(.*?)#/' and '$1' respectively. This results is the same string as the original 'main_image' field value but minus the '#'. that is: "images/products/t-shirts/carnivore/military-green-1000x1000_Bull_coloured_-_I_also_like_Cake-orange-text-f0a253.jpgjoomlaImage://local-images/products/t-shirts/carnivore/military-green-1000x1000_Bull_coloured_-_I_also_like_Cake-orange-text-f0a253.jpg?width=1000&height=1000"

regex101.com with the same input value results in the correct "images/products/t-shirts/carnivore/military-green-1000x1000_Bull_coloured_-_I_also_like_Cake-orange-text-f0a253.jpg"

The Rule is applied to the 'main_image' field in the Template, which is where I am getting these results from. i have also used the 'Maintenance' option to cache the SEF urls as suggested.

What am doing wrong here?

chop to the hash.jpg
sefs set.jpg
Attachments (2)
Accepted Answer Pending Moderation
Hello,
Please post the requested details asked in your other post here. We can look at both SEF issue and also image issue.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!