Article Symlinks with MidCOM

Wed 8th December 2004 10:02 EET

I can't remember how many times I've done this patch to one of our clients in order to maintain their Aegir-legacy article symlinks. Yet, every other time I upgrade their MidCOM components, namely de.linkm.taviewer, I forget to re-apply the patch.

For those who are unaware of the article symlinking in Midgard. The ultimate goal was to share article contents in several locations where similar content would be needed. Before symlinking support, the only way would have been copy-pasting and then maintaining several content locations when the content changes => very painfull when one has 2500 articles! Symlinking was first introduced in Aegir CMS as that was the Midgard UI of the choice at that time.

So, it's mainly about static content and article storage (bank) ideology. The logical point for the MidCOM implementation is of course the de.linkm.taviewer component. And here's the patch I'm currently using (in snippet: /de/linkm/taviewer/_code/viewer):

143: if ($realartguid = $this->_article->parameter('midcom.symlink','GUID')) {
144:     //$this->_article = mgd_get_object_by_guid($realartguid);
145:     $realart = mgd_get_object_by_guid($realartguid);
146:     $this->_article->abstract = $realart->abstract;
147:     $this->_article->content = $realart->content;
148: }

The first idea was to replace the whole article object (see line 144). This proved insufficient as this would also change the article title and other fields that might be used differently in different parts of the site.