Skip to content
This repository has been archived by the owner on May 29, 2022. It is now read-only.

ayecue/Classparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Classparser

Compatible with Pimcore 3.x.x

Description

Plugin to enable user in the CMS to add their own classes to a component. When you install this plugin an Object named "Classhelper" will be automaticly added. This object got two default fields. One mandatory field named "classtag" and one optional field named "description".

Use the field "classtag" to define classes like for example "bgcolor-blue". Use the field "description" to describe to the user what this class does. In this example I just would write something like "Makes background blue!".

Example:

Imagine you got this CSS file:

.bgcolor-blue {
	background: blue;
}
.bar {
	color: black;
}
.foo {
	border: 0;
}

Also imagine that you got a view like this:

<?php
	$myClassparser = $this->classparser("myDivClasses");

	if ($this->editmode) {
		echo $myClassparser;
	}
?>
<div class="<?php echo $myClassparser->getClass(); ?>">
</div>

Now imagine that you have added three different classes to the classparser like "bgcolor-blue", "bar" and "doh". The output would be:

<div class="bgcolor-blue bar doh">
</div>

How to install

  • Create folder and drop files in "/plugins/Classparser"
  • Go to extension menu and click enable and install