The modifier system is responsible for all the communication between the different designers, anytime a user changes user data that could affect another piece of user data the modifier system is called, it checks the change requests and then based on the results makes silent changes by calling modifiers, currently there is only one modifier but more will be added as required.
One of the core goals for Dlayer is full control of every attribute and element, this isn’t just a hollow promise, even if a template is being used by numerous pages the user should be able to edit the template without concern that any dependant data will be destroyed.
This is a very difficult goal to achieve, especially as Dlayer gets more complicated, both via inter communication and as the number of tools increases. As it stands today I’ve not met the goal, three tools (split vertically, horizontally and resize) are disabled if data is potentially going to be destroyed, and one (border) calls the modifier system, as I update the Template designer I’ll get closer to meeting the goal.
In Dlayer pages are created from templates, templates are used to define core items that need to appear on each page, obvious examples being the header, menus and the site footer, there will typically be a low number of templates for a website with many pages being based on each template.
If a user edits an active template by managing the border of a template block the usable size of the template block will change. As a consequence, content items could be affected directly by either being too large for the block or indirectly by the layout being altered. When a change happens in the Template designer the modifier system is called, it checks all content for items that could be affected and then calls the modifier system against each of them to see if a change needs to be made, if a change is required the content items will be modified before the change is made to the template.
When checking to see if content items needs to be altered the system doesn’t just check to see if a content item will no longer fit, it will also check to see if the content item was originally the same size as the page block and also check to see if the content item was smaller than the page block by less than the change size, in both cases the previous proportions will be maintained when the content items size is altered.
The modifier system will alter the width of a content item leaving any existing borders and padding intact, shortly it will be updated to prioritise changes to the margin values (position) before altering the width.
When content grouping tools are added the modifier system will be updated to respect a group, currently it operates in individual content items.