Developer forum

Forum » CMS - Standard features » Search (Paragraph ID)

Search (Paragraph ID)

Peter Munkholm
Reply

I have a sad situation.

On a pages of a website, we have paragraphs. The titles are shown, but the content is hidden with javascript. The idea is to give a more graphic presentation, so when you click on the titles, the content folds out.

Now in order to automate this from a search result, we need the paragraph id. There is no template tag for this, and there is no data in the xml.

Can i be true, that you can search content of paragraphs, but not get the ID of the paragraphs?


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Peter

I assume you are using search weigthed? It searches pages - a page contains of X paragraphs and no, you do not have a list of paragraph id's available as tags for each search result item in the search result template.

Nicolai

 
Peter Munkholm
Reply

As far as your database structure goes, pages have no content, so you can't search them. Pages have paragraphs and paragraph have content. Each paragraph have a reference to a page ID, but each paragraph also has its own ID.

Even when you search, you get references to paragraphs and not unique references to pages. If a page contains 5 paragraphs, and 2 of them contains the search phrase, the page will show up twice in the search result. If you included the id of the paragraph you could use that as an anchor, and even make the target page scroll to the paragraph with the content you searched for.

Just thought it would be very useful to have the paragraph. But in my scenario, and a lot of others.

The customer has the datalist module, so I can easily make my own SQL search, and get the output that I need. And I can even make that SQL as a stored procedure, and have the datalist execute that in stead. Will make it much faster... *hint, hint* cheeky

 

 

You must be logged in to post in the forum