Hey KK,
How my site is structured is by the normal SEO standard,
one root file for each language so :
index.php -> for redirection to my main language that being english
-en/index.php
-nl/index.php
I already achieved the results i wanted thru php arrays and seperating them with if statement like so :
- Code: Select all
<cms:if lang=='en'>
<cms:editable name='carousel_img1' label='Slide 1 Image' group='carousel' order='4' required='1' show_preview='1' preview_width='250' type='image'/>
<cms:editable name='carousel_img2' label='Slide 2 Image' group='carousel' order='9' required='1' show_preview='1' preview_width='250' type='image' />
<cms:editable name='carousel_img3' label='Slide 3 Image' group='carousel' order='14' required='1' show_preview='1' preview_width='250' type='image' />
<cms:editable name='carousel_img4' label='Slide 4 Image' group='carousel' order='19' required='1' show_preview='1' preview_width='250' type='image' />
<cms:editable name='carousel_img5' label='Slide 5 Image' group='carousel' order='24' required='1' show_preview='1' preview_width='250' type='image' />
</cms:if>
So here were checking if the language is english if so i am able to edit the images as i dont want the images to be editable on all the languages and retrieve them like so :
- Code: Select all
global $carousel_imgs;
$carousel_imgs = array(
1 => '<img src="<cms:get_custom_field 'carousel_img1' masterpage='en/index.php' />" alt="carouselimage1" />',
'<img src="<cms:get_custom_field 'carousel_img2' masterpage='en/index.php' />" alt="carouselimage2" />',
'<img src="<cms:get_custom_field 'carousel_img3' masterpage='en/index.php' />" alt="carouselimage3" />',
'<img src="<cms:get_custom_field 'carousel_img4' masterpage='en/index.php' />" alt="carouselimage4" />',
'<img src="<cms:get_custom_field 'carousel_img5' masterpage='en/index.php' />" alt="carouselimage5" />'
);
As this works perfectly for me, but i just found out about the repeatable tag and when i can do what i want with limits and language structuring what is able to edit and what not this allows me to get rid of pesky arrays

. Not to mention a much less cluttered admin and cleaner code

!
EDIT:
In this case i need it to be arrays btw since im injecting them into an javascript array but i use them all over the place where the repeatable region is a far better approach or even THE only approach to handle such a thing as the arrays arent dynamic and flexible etc.
Ty