Can't finish project...

More
6 years 8 months ago - 6 years 8 months ago #68897 by ggppdk
Replied by ggppdk on topic Can't finish project...
Hello

yes it will not work, because HTML of all items is in a single string

anyway i have finished (and mostly tested too)
  • custom layouts for both
    relation and relation reverse
  • added all display options of relation field to relation reverse
  • improved configuration for viewing display to be more clear


the custom layout now contains the HTML per related item
which is then made in the final single display string

thus your replacements will work in a custom layout

this will be available soon


-- 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: 6 years 8 months ago by ggppdk.

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

More
6 years 8 months ago #68904 by ggppdk
Replied by ggppdk on topic Can't finish project...
Hello

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

please do as soon as possible


-- 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
6 years 8 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
6 years 8 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
6 years 8 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
6 years 8 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.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.300 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