ukyo Posted October 7, 2023 Posted October 7, 2023 Module help you to create and use set of components to utilize in your ProcessWire. You can find more info and an examples on Github repo : https://github.com/trk/Component/tree/main 6
aagd Posted October 22, 2023 Posted October 22, 2023 Hello @ukyo, thanks for sharing this. I tried the module with your example code. The content and tag params work fine, but others like size etc. didn't output anything. Shouldn't they appear as CSS classes? Am I missing something? (PW 3.0.229, PHP 8.1 & 8.2) <?php echo component('heading', [ 'content' => 'Hello World!', 'tag' => 'h3', 'size' => 'text-large', ]);?>
ukyo Posted October 22, 2023 Author Posted October 22, 2023 Hi @aagd Example code is combination of https://getuikit.com/docs/heading and https://getuikit.com/docs/text. Size, decoration, transform, color and align params adds classes to component. If you include uikit 3 on your project or if you check the output. You will see the result on component output.
aagd Posted October 22, 2023 Posted October 22, 2023 @ukyo I'm sorry, that I wasn't clear. I meant the classes are not appearing in the markup. All I get is <h3>Hello World!</h3> while I expected it to be <h3 class="uk-text-large">Hello World!</h3>
ukyo Posted October 22, 2023 Author Posted October 22, 2023 @aagd I pushed an update, this update has fix for attributes to string fix and added an example component. This component contains example on readme file with 2 different output solution. Method 1 is commented https://github.com/trk/Component/blob/8b973cca955a29fd60c933da9ff9a6d35f5e518b/components/example/templates/template-default.php#L11 Method 2 classic way https://github.com/trk/Component/blob/8b973cca955a29fd60c933da9ff9a6d35f5e518b/components/example/templates/template-default.php#L24 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now