Can't finish project...

More
7 years 4 months ago #68909 by lipatovroman

ggppdk wrote: Hello

you can now use / test the custom layout for relation / relation reverse fields

please do as soon as possible


Hi! Yes, custom layout works fine. I only can't understand how to append text inside <a href></a>...

I added "test" text in code



it displays outside of link:

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #68910 by ggppdk
Replied by ggppdk on topic Can't finish project...
Hello

you need to do it in the custom HTML parameter inside field 's configuration

The inside the layout you can replace:
Code:
foreach($related_items as $rel_item) { $HTML->items_list[$rel_item->id] = $rel_item->ri_html; }

with
Code:
foreach($related_items as $rel_item) { if ( strpos($rel_item->ri_url, '/windows/') !==false) { $rel_item->ri_html = str_replace('__REL_TEXT__', ' for Windows', $rel_item->ri_html); } $HTML->items_list[$rel_item->id] = $rel_item->ri_html; }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #68911 by lipatovroman
Ok, done.

I added this code:
Code:
if ( strpos($rel_item->ri_html, '/windows/') !==false) { $HTML->items_list[$rel_item->id] = str_replace ('__REL_TEXT__', ' for Windows', $rel_item->ri_html); } elseif ( strpos($rel_item->ri_html, '/macos/') !==false) { $HTML->items_list[$rel_item->id] = str_replace ('__REL_TEXT__', ' for macOS', $rel_item->ri_html); } elseif ( strpos($rel_item->ri_html, '/android/') !==false) { $HTML->items_list[$rel_item->id] = str_replace('__REL_TEXT__', ' for Android', $rel_item->ri_html); } elseif ( strpos($rel_item->ri_html, '/ios/') !==false) { $HTML->items_list[$rel_item->id] = str_replace('__REL_TEXT__', ' for iOS', $rel_item->ri_html); } else { $HTML->items_list[$rel_item->id] = $rel_item->ri_html; }

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #68912 by ggppdk
Replied by ggppdk on topic Can't finish project...
Hello

i will add a comment in the layout file:
Code:
// NOTE: besides normal item data, like ...->title, ...->created, ...->fields // you can also use ...->ri_html and ->ri_url


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago - 7 years 4 months ago #68913 by ggppdk
Replied by ggppdk on topic Can't finish project...
Hello

better use (for strpos):
->ri_url

it is a smaller string and will have a little better performance


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 7 years 4 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
7 years 4 months ago #68914 by lipatovroman
Thank you!

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.355 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline