Ensuring current revision in auto-index query

Hello

This is a basic question I know but…

I have a series of auto-indexes which are returning multiple versions of the same item. I know this is caused by NOT specifying the current revision, but am not sure how to add this selector to my query.

My code is

select sh_local_publish_date from rx:nhmBookPage where rx:book_category = 'Evolution' order by sh_display_title asc

Everything else in the query works perfectly.

Thanks,
Cara

Hi Cara

When create auto indexes you only need the contentid and folderid in the select statement eg

select rx:sys_contentid, rx:folderid from rx:nhmBookPage

Is there a specify reason you have a local field in the query?

Cheers
James

Hi James

I changed the query as you suggested (from the shared field to rx:sys_contentid, rx:folderid) but all the revisions are still showing up in the preview. I removed the auto-index from the slot and re-added it, just to make sure and edited the actual auto-index item too, just to increase the revision for publishing purposes. Nothing has changed.

Is there another field I should add to ensure only the current revision is displayed?

Regards,
Cara

Anyone got any possible solutions for this issue?

Cara

Cara,

Would you mind attaching a screenshot of the form you’re filling in with your query, just sop we can all be sure we’re talking about the same thing? Like previous posters, every time I’ve done an auto-slot, I’ve never had to worry about revisions… the current or edit revision is automatically chosen as you’d expect.

Also, Would you mind attaching the code you’re using to pull in the auto-slotted content into your template? There may be something there too.

Thanks.

Hello

I have attached a PDF, with screenshots, listing the steps needed to create a new auto-index from scratch through to publish.

If you need any other information, please let me know.

Regards,
Cara

Cara,

Thanks for the SSs, that really cleared up the situation. I’ve never seen an implementation like the one you’ve got, but it looks like it could be pretty slick once this issue is worked out.

Do you use museum-auto-index( 37658 ) for all your items of this type? If so, this arrangement can be improved. As far as I can tell, the reason you’re experiencing what you are is that you’re not actually using Auto Slots… I’d be interested to see the source and bindings of the nhmSnAutoIndex template to confirm my suspicion here.

Forgetting all that, you can only use a variable for auto-slot queries in where clauses, and only then as the value of the field. Here’s what you’ll need to do to convert to a 6.5+ -style auto slot:

[ol][li]Change your keywords to all conform to: year=XXXX&category=YYYY. Use a percent sign (%) when you don’t need to select against one of the fields. Your “About the Museum” value would become: year=%&category=About the Museum[/li][li]Create a dispatch template (if there is more than one desired output template and you need to pick one) for the content of the slot so that all results can be processed by the same template, and call it “MuseumDispatch”. There is documentation available to help you make a dispatch template if you need it. You’ll need to allow this template for each content type returned by any of the queries.[/li][li]Change your slot to use Content Finder sys_AutoSlotContentFinder with the following settings:query: select rx:sys_contentid, rx:sys_revision from rx:nhmBookPage where rx:book_category like :category and rx:book_year like :year[/li]type: sql
template: [i]YourTemplatep/i[
[li]Add the nhmBookPage content type to the “Allowed Content” section of the slot.[/li][li]Make sure the slot’s Allowed Relationship Types is “ActiveAssembly” and the slot type is “Regular”[/li][li]In your template’s source, include the content of the slot as usual with the caveat that you use the query value for the params to the slot macro. For example:#slot(“Auto-index” “” “” “” “” $sys.item.getProperty(‘rx:query’).string)[/ol][/li]
This should do it for you… This was a fun exercise in problem solving. Please let us know how it goes.

Ignore step 2. It was from a previous version of the steps, and i forgot to remove it before the session expired.

Also, step 3 has an obvious typo. Please forgive :slight_smile:

Hi Rushing

Thanks for the fix. Today is my last day before Christmas, so will not have time to do this today. However, I will update you in the New Year.

Kind regards,
Cara