Hi Folks,
Implementing a upcoming events list asset and on the display format contents I have:
[html]<tr class="%asset_odd_even%">
<td>%asset_metadata_event_type%</td>
<td>%asset_metadata_speaker% %asset_name_linked%</td>
<td>%event_start_date% %event_start_time_24h% (%event_duration%)<br /> %asset_metadata_location%</td>
</tr>[/html]
(with the table, th etc in the page contents).
The %asset_name_linked% field doesn't output anything.
Tried creating something similar with an normal asset listing and the field is printed. Does that keyword not work in an upcoming events list asset?
Cheers
K
ps 3.18.4
[quote]Implementing a upcoming events list asset and on the display format contents I have:
[html]<tr class="%asset_odd_even%">
<td>%asset_metadata_event_type%</td>
<td>%asset_metadata_speaker% %asset_name_linked%</td>
<td>%event_start_date% %event_start_time_24h% (%event_duration%)<br /> %asset_metadata_location%</td>
</tr>[/html]
(with the table, th etc in the page contents).
The %asset_name_linked% field doesn't output anything.
Tried creating something similar with an normal asset listing and the field is printed. Does that keyword not work in an upcoming events list asset?[/quote]
The %asset_name_linked% keyword is only available in Listing Engine-based assets such as Asset Listing and Search Page.
In order to add a link in the Calendar Page, the following code will need to be used:
%asset_name%
[quote]The %asset_name_linked% keyword is only available in Listing Engine-based assets such as Asset Listing and Search Page.
In order to add a link in the Calendar Page, the following code will need to be used:
%asset_name%[/quote]
Thanks was just checking... :-)
A follow up Q if I may? Been reading a few of the older forum threads about paint layouts and asset listings (Nic's blog comments being the most confusing in my current semi-braindead state ;-) but am still floundering a bit.
In the upcoming events list i want an condition to appear based on metadata (do that if the speaker field isn't set it doesn't get painted) so I need to create and apply the paint layout but the layers are confusing me. How I'm testing things
Create the Upcoming Events List asset
In Page Content:
| Event Type | Details | Where / When |
|---|
In the Type format for Single Calendar Event
%asset_metadata_event_type% %asset_metadata_speaker% %asset_name% %event_start_date% %event_start_time_24h% (%event_duration%) %asset_metadata_location%
Works fine. Want to do that in the paint layout so I can apply the conditions... choose to customise the Upcoming Events List. Goto type formats... remove the %asset_contents% and place in some asset specific stuff (list %asset_name%)... prints out the name of the 'Upcoming Events List' not looping through the events. ok - try and customise the single calendar event and that doesn't have an effect at all...
What am I missing from this?
Help Much appreciated
K
Sorry if I confused you or anyone else on my blog! :) I will try to do better to explain things.
[quote]What am I missing from this?[/quote]
The problem here is, you cannot apply a paint layout to an upcoming events list and have it paint each asset similar to how an asset listing can do this. This feature does not work for Calendar assets, and only works for asset listings. So, sadly, if you are wanting conditional keywords for each item of the Upcoming Events list, it is not going to work in this case.
If you really need this, you might be better off just using javascript to see if a field has content and hide if it doesn't, and show if it does. :)
No - it was the thread about nested comments going down multi-levels I couldn't get my head around... actual blog fine ;-)
[quote]The problem here is, you cannot apply a paint layout to an upcoming events list and have it paint each asset similar to how an asset listing can do this. This feature does not work for Calendar assets, and only works for asset listings. So, sadly, if you are wanting conditional keywords for each item of the Upcoming Events list, it is not going to work in this case.
If you really need this, you might be better off just using javascript to see if a field has content and hide if it doesn't, and show if it does. :)[/quote]
Ah - ok. Can do that ;-) Just out of curiosity how should it work with an asset listing? the paint layout format overrides the format in the listing?
Cheers
K
Say you have an asset listing that is listing Single Calendar Events. You create the asset listing, and configure the type format for the Single Calendar Event, and only add the %asset_contents% keyword into that type format.
Then, create and configure a paint layout for Single Calendar Events, and in THIS type format, put your keywords and formatting for how you want each listed item to look. Then, apply this paint layout to your asset listing using the lookup settings screen.
So, your asset listing should now be using the paint layout for painting each asset that is listed. Then you can easily add conditional keywords.
I too wish that it worked with Calendar listing assets. :)
I take it as it doesn't use the listing engine you cannot generate RSS from an upcoming list either? Any genius workarounds for that?
TIA
K
[quote]I take it as it doesn't use the listing engine you cannot generate RSS from an upcoming list either? Any genius workarounds for that?
TIA
K[/quote]
No, I don't think you can.
The Calendar assets don't create a clean file. They insert some javascript and stuff into the page by default, which can't be removed.
Use an Asset Listing to list the Calendar Events, then create the RSS Feed from that.
I did look at that but couldn't see a way to filter / restrict the list to only events in the future?
K
[quote]]
I did look at that but couldn't see a way to filter / restrict the list to only events in the future?
K[/quote]
This isn't possible with just a plain asset listing. 
But you can discern between events through other methods such as status, and group your events as follows:
- Upcoming Events: Live
[*]Past Events: Up for Review
You can create a trigger watching: Asset Updated for type: Event and Tree Location that sets an events' future status to the event_end_date.
Both Live and Up for Review are visible to the public, but if these status' are used for other purposes, there should be other properties able to be set to differentiate between events, such as link value.
Good luck!
…of course I realised another work around. Just format the upcoming asset to produce the RSS. For anyone stumbling across this thread later:
- Set up a new Upcoming Event List called events.rss
- Create a New design
[codebox]<MySource_PRINT id_name="global" var="content_type" content_type="text/xml" />
<?xml version="1.0" encoding="iso-8859-1"?>
<MySource_area id_name="body" design_area="body" />[/codebox]
And apply it to the list
- In the Page Contents make sure you are outputing Raw HTML then
[codebox]<rss version="2.0">
<channel>
<title>My Title</title>
<link>%asset_url%</link>
<description>My Description</description>
%event_list%
</channel>
</rss>[/codebox]
- In the type format (again raw html) contruct the item (my example is like so)
[codebox]
<item>
<title>%event_start_date% %asset_metadata_event_type% %asset_name% %asset_metadata_speaker%</title>
<link>%asset_url%</link>
<description>
%event_start_date% %event_start_time_24h% (%event_duration%) %asset_metadata_location%
</description>
</item>[/codebox]
And it seems to work.
K
[quote]And it seems to work.
K[/quote]
Really? If so this is great!
Last time I tried this, it would print some default javascript and comments in the code even if you did not want them. You might want to look at your file and make sure that Matrix is not printing those in your .rss.
[quote]Really? If so this is great!
Last time I tried this, it would print some default javascript and comments in the code even if you did not want them. You might want to look at your file and make sure that Matrix is not printing those in your .rss.[/quote]
nope - nothing extra I don't want. Just the generated rss…
K
[quote]nope - nothing extra I don't want. Just the generated rss…
K[/quote]
Good to know!