How to make a "singleton" block?
Permalink
Hi folks,
i'm new to C5 but i have years of experience as a software developer. Most of the time I've been building highly customized software systems which don't fit into a CMS but lately a customer of our company asked us to build a small site for them based on a CMS. After a first research we agreed on using C5 because of it's concepts and clean software architecture.
Most of the requirements are straight forward tasks which we can solve using standard C5 features. There is one requirement though, which I've no clue how to solve elegantly.
In some place on the site there must be tables listing a "best X" of a product Y. There are different tables and for now I plan to implement this by a custom developed block. Content editors can then add this "Ranking" block to the page and add/edit the single rows/records.
Since the page is planned to be multilingual these blocks with the same content should appear on different pages in the sitemap (E.g. en/statistics/, it/statistics, es/statistics and so on). So if I populate the english pages and add my custom block to a page somewhere in the en-branch of the sitemap and pupulate this block with data, how can I "reuse" this block with the same data in the it- or es-branches of the sitemap? And if the content editor updates the data in one of the block "instances" how can I get sure that the content gets update in the other "instances"?
Hopefully my problem description is not too confusing. It can also be that I've completely overseen the missing bit in the documentation.
Cheers,
Alfred
i'm new to C5 but i have years of experience as a software developer. Most of the time I've been building highly customized software systems which don't fit into a CMS but lately a customer of our company asked us to build a small site for them based on a CMS. After a first research we agreed on using C5 because of it's concepts and clean software architecture.
Most of the requirements are straight forward tasks which we can solve using standard C5 features. There is one requirement though, which I've no clue how to solve elegantly.
In some place on the site there must be tables listing a "best X" of a product Y. There are different tables and for now I plan to implement this by a custom developed block. Content editors can then add this "Ranking" block to the page and add/edit the single rows/records.
Since the page is planned to be multilingual these blocks with the same content should appear on different pages in the sitemap (E.g. en/statistics/, it/statistics, es/statistics and so on). So if I populate the english pages and add my custom block to a page somewhere in the en-branch of the sitemap and pupulate this block with data, how can I "reuse" this block with the same data in the it- or es-branches of the sitemap? And if the content editor updates the data in one of the block "instances" how can I get sure that the content gets update in the other "instances"?
Hopefully my problem description is not too confusing. It can also be that I've completely overseen the missing bit in the documentation.
Cheers,
Alfred
One for the blocks (as any normal block would), and one for the ranking data that will be the same for all the blocks in the different language sections.
Or have a look at the translation functions t() and see how you can use them for your blocks. And then put your block in a stack with the ranking data in the block's own table.
http://www.concrete5.org/documentation/developers/5.7/working-with-...