Thank you Jo and Velden,
Jo Morg wrote: ↑Wed Oct 14, 2020 12:59 pm
I'm not sure I understand why you would want to use the url for this.
Currenty it is no longer needed to get to detailpage of instance B. But it is still not finished. I try to explain what this is all about.
Instance A is the home page. An image gallery. All images are reffered to other content pages with image galleries (LISE module instances).
So Instance B is also an image gallery, but with a simple kind of shop function (not in a legal sense, the contract will be made later). A gallery of books and calendars, some of them can be ordered/reserved - but only temporarliy. For that the detail view shows a formbuilder form. Product title and price of the item are transfered automatically to the mail form template.
And there is also a a field definition named "counter" to insert a number of the article in stock. A little selfmade plugin causes that everytime a mail has been sent one number is subtracted from the counter. As soon as 0 is reached, the order button disappears.
{if $item->fielddefs.count ne '' && $item->fielddefs.count ne '0'}<a class="order" href="{$item->url}" title="order {$item->title}">Order</a> {/if}
So my first idea was: While an images in the shop is marked as a sales article it should be able to be ordered from the hompage too.
That is why I could not work with a seperated detail view in instance A.The identical article would be handled as two articels.
But as I said the detail URL of instance B is no longer needed in instance A. instead a text alert like "order now" should be displayed in some selected items of the summary of instance A (=home page). I helped myself with a field definition "show alert". It's not a perfect solution because the alert has to be deactivated manually when the article is sold out.
Perfect was when the alert text on the home page would depend on the counter of the shop too. As shown in the code above. But for that I need to have access to the counter field definition of instance B (=shop).
Jo Morg wrote: ↑Wed Oct 14, 2020 12:59 pm
Then you could do things like this:
Code: Select all
{foreach from=$items item=item}
{LiseInstanceB action=detail item=$item->instanceB_item_alias}
{/foreach}
When I do that a detail view of instancs B is displayed in instance A with normal text only. Field definitions and If/elses will be ignored.