Content Relating to content addon
Permalink 1 user found helpfulThanks for the help.
Luan
Thanks Wagdi, I'm not looking for anything ecommerce, but the random block seems really cool and useful.
After you add the attribute, go to some pages in the site, edit them, click the "Properties" button, click the "Custom Attributes" tab, and add the "Related Content Category" from the "**Add Attribute**" dropdown menu. Then check a box or two for which category it's in.
After you have a few pages put into a category, go to another page and add this block. In the edit dialog, choose the category you want, and the related content pages (the ones you checked the appropriate category for up above) should appear in the list.
If it works for you, let me know -- would be nice to throw this up on the marketplace (would want some testing first though).
-Jordan
where do you put this file? If I put it in the Packages folder nothing happens and if I put it in the blocks folder I get an error message that renders my site useless until I delete the block out of the folder...
Thanks,
Ryan
What you have to do is put it in YOURSITE/blocks/ (not in YOURSITE/packages and not in YOURSITE/concrete/blocks/). But note that sometimes when you unzip this is might get unzipped into 2 nested folders -- you want to make sure that the folder you put in your blocks directory doesn't itself contain sub-folders -- it should just be a folder called "related_content", and inside that folder should be some files (add.php, auto.js, controller.php, etc.).
I did exactly what you wrote... But I still cannot insert the block into a page. The folder is located in mysite/blocks and it has no subfolders. I cleared the cache and refreshed the database.. Do you know what's wrong?
Best
Mathias
I did exactly what you wrote but the block is not shown in the list...
Do you know, what could be wrong?
Best Mathias
I found out the way to display that block...
But I have another question now:
Could this function be hardcoded in a template?
I am building a site for some lectures with several professors.
Under the personal data of a professor, I would like to display a list with the lectures of that professor.
And under every abstract of a lecture I would like to display the name of the professor.
I think, there must be a way to do that by filtering attributes.
Best Mathias
This is awesome. Thanks for posting this! It's almost exactly what I'm looking for in this thread:
http://www.concrete5.org/community/forums/customizing_c5/how-do-i-a...
What would it take to add a page type selector to this block? This way I could select Page Type = "Patent" (or "** All **") and also select the related content value.
(In case you weren't aware, the terms "page" and "collection" are for the most part interchangeable in the C5 API, so "collection type handle" means the same thing as "page type handle" for example).
Good luck!
$pl = new PageList(); $pl->sortBy('cvDatePublic', 'desc'); $pl->filter('p1.cID', $c->getCollectionID(), '!='); $categories = explode("\n", $c->getCollectionAttributeValue('categories')); $query_parts = array(); foreach ($categories as $cat) { $query_parts[] = "'%\n".$db->escape($cat)."\n%'"; } $catQuery = implode(' OR ak_categories LIKE ', $query_parts); $pl->filter(false, '(ak_categories LIKE '.$catQuery.')');
not sure if it's the right way to go about it...
If the former, nothing exists to do this in the C5 world. I know there's a wordpress plugin or feature that does this but I've honestly never found it to really be worthwhile -- it just kind of does a blind word matching thing and the content is never really that related.
If you just need a way to denote related content on your own, just add a content block to the sidebar and insert some links to other pages in the site.
-Jordan