Download the PHP package melasistema/hyde-layouts-manager without Composer
On this page you can find all versions of the php package melasistema/hyde-layouts-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download melasistema/hyde-layouts-manager
More information about melasistema/hyde-layouts-manager
Files in melasistema/hyde-layouts-manager
Package hyde-layouts-manager
Short Description Effortless HydePHP Layouts and Components Management. HydePHP Layouts Manager is a powerful Composer package that simplifies the way you manage layouts and reusable components within your HydePHP projects.
License MIT
Informations about the package hyde-layouts-manager
HydePHP Layouts Manager
Simplify layout and component management in your HydePHP projects.
HydePHP Layouts Manager is a powerful package designed to simplify the management of layouts and reusable components in your HydePHP projects. It provides an intuitive way to organize and customize themes, layouts, and components with centralized presets and easy override, enhancing your workflow while keeping your codebase clean and maintainable.
Check it out in action: HydePHP Layouts Manager
๐ Features
-
Dynamic Layout Management: Seamlessly switch and manage layouts across your HydePHP site for a consistent and adaptable design.
-
Reusable Components: Craft modular, customizable components with intuitive default attributes, enabling flexibility and reuse.
-
Font Manager: Typography is more than textโit's the voice of your design. With access to 1,790 font families from Google Fonts, you can shape the personality of your site to reflect your identity. Let every word speak volumes, with fonts tailored to inspire, inform, or captivate.
-
CLI Tools: Streamline your workflow with powerful commands for listing layouts, merging configurations, and automating essential tasks.
-
Built-in Flowbite Support: Enhance your site with beautiful, pre-designed components from the Flowbite library, perfectly integrated for ease of use.
- Customizable Themes: Transform and extend your layouts with fully customizable themes, tailored to your vision.
๐ Requirements
Before installing this package, make sure your project meets the following prerequisites:
Core Requirements
- HydePHP Framework: This package is specifically designed for projects built with HydePHP. Ensure you are using version
^1.7
or higher. - PHP Version: Your project must be running PHP 8.1 or newer to guarantee compatibility with both HydePHP and this package.
- Composer: Ensure that Composer is installed and configured in your development environment for dependency management.
Font Manager Requirements
- Internet Connection: An active internet connection is essential for the Font Manager to dynamically fetch font families from Google Fonts.
- Environment Configuration: Set the
DEFAULT_LAYOUT
variable in your.env
file to ensure the correct fonts are applied and mapped based on your selected layout. This allows centralized and dynamic typography management.
Why These Requirements Matter
These prerequisites ensure that the package functions as intended, especially for dynamic font management, layout switching, and integration with HydePHP. Proper setup guarantees a seamless and feature-rich experience.
๐ ๏ธ Installation
1. Install via Composer
Use Composer to add the package to your project:
2. Set the Default Layout in .env
To ensure the package works as intended, add the DEFAULT_LAYOUT
variable to your project's .env
file.
This value is critical for enabling dynamic typography management.
You can change this value to hyde
or any custom layout defined in HydePHP Layouts Manager. Refer to the README Usage Section for more details.
2. Publish the Configuration
Publish the package's configuration file to your app's config
directory for customization:
3. Merge Tailwind Configuration
Manual Merge
Manually include the Layouts Manager configuration in your tailwind.config.js
file:
Automated Merge
Automate the process with the tailwind:merge
command. This replaces your existing tailwind.config.js
file with the default configuration from HydeLayoutsManager.
โ ๏ธ Warning: This will overwrite your existing file. Back it up if you have custom configurations.
Run the command:
4. Install Required JavaScript Dependencies
The default theme and components shipped with HydeLayoutsManager use Flowbite. You can add these dependencies manually or by using the package-json:merge
command.
Manual Installation
Add the following Flowbite dependencies to your package.json
file:
Then, install the dependencies:
Automated Merge
Use the package-json:merge
command to automatically merge the Flowbite dependencies into your existing package.json
.
โ ๏ธ Safe in Fresh Projects: This command modifies your package.json
. Ensure to back it up if you have custom dependencies.
Run the command:
Afterward, run:
5. Add Flowbite Styles and Scripts to Laravel Mix Webpack
Add Flowbite styles and scripts in you webpack.mix.js
file:
Run the Laravel Mix build:
6. Modify the @extends Directive
Add dynamic @extends() directive to your pages for the "Layout Switching" es. index.blade.php
:
If you are using a post page, you can use the active layout blog post feed:
7. (Optional) Publish Views
If you want to customize the default views, publish them to your application:
Final Steps
After completing the installation, youโre ready to build dynamic layouts and reusable components with HydePHP Layouts Manager! ๐
๐งฉ Usage
Setting the Default Layout
The default layout for your site is determined by the DEFAULT_LAYOUT
value in the .env
file. This ensures centralized and dynamic configuration across all functionality, including the "HydePHP Layouts Manager" and "Typo Manager."
To set or switch the default layout, update your .env
file:
Note: Setting this value in the
.env
file is crucial for proper functionality, as the Tailwind JavaScript configuration usesprocess.env
to dynamically apply styles and fonts.
Customizing Layouts
Layouts are defined in the layouts
section of the configuration file. Each layout can include unique views, styles, scripts, and navigation settings:
Tip: Define multiple layouts (Themes) in the configuration file to suit different pages or sections of your site, and switch them easily via the
.env
file.
๐ Example Project Structure
Below is an example of how your project could be structured after installing the package:
๐ Managing Typography
Typography is a crucial aspect of design, shaping the visual identity and readability of your site. The Font Manager in HydePHP Layouts Manager provides access to 1,790 Google Fonts, enabling you to customize and manage fonts dynamically. Each Layout (Theme) can have its own font settings and mapping, allowing you to tailor typography to match your design vision.
file: config/hyde-layouts-manager-fonts.json
Note: If you want to use a layout without Typo Manager (Google Fonts CDN) you can set
use_google_fonts
tofalse
and empty thefamilies
andtypography_mapping
arrays to fall back tosystem-ui
fonts.npm run dev
to compile the assets it's required after those changes.
๐งฉ Using Components
Components are reusable UI elements with configurable defaults. The package provides a method to dynamically render components in your Blade templates.
Using renderComponent()
The renderComponent()
method, provided by the HydePHP Layouts Manager
, dynamically renders components with the ability to override default configurations. Keep in mind that all preset groups are merged into the settings
.
Example: Overriding the Jumbotron
Component
Here's an example of how to override the Jumbotron
component's default
presets using the styleKey
:
This method fetches the component configuration from the hyde-layouts-manager.php
configuration file using the presets
that can be defined with the styleKey
, allowing you to:
- Define multiple
presets
for each component. - Override settings dynamically at runtime.
Configuring Components
You can customize or create multiple presets settings for components in the hyde-layouts-manager.php
configuration file within the styles
array. For example:
Key Parts of the Configuration
components
: The top-level key for all components.flowbite
: The namespace or grouping for Flowbite-based components.carousel
: The specific component being configured.default-slider
: The identifier for this specific preset of the carousel.view
: Specifies the Blade template used to render this preset.styles
: Contains all available style presets for this component.default
: The name of the style preset (you can define multiple presets here).
config
: Holds the customizable settings for the component:layout
: Layout options like showing indicators or controls.settings
: Additional configuration options that can be extended.images
: Default images to be used in the carousel.
Benefits of renderComponent()
- Dynamic Overrides: Easily override defaults for individual component instances.
- Centralized Configuration: Maintain consistent default values in the configuration file.
- Flexibility: Simplifies re-usability for components across projects.
By leveraging these methods, you can build scalable and easily customizable layouts with HydeLayoutsManager. ๐
CLI Tools
The package includes several Artisan commands to streamline your workflow:
-
List Layouts: Display available layouts:
-
Merge Package JSON: Merge dependencies into your
package.json
: - Merge Tailwind Config: Merge Tailwind configurations into your
tailwind.config.js
file:
Customization
Adding New Layouts
You can add custom layouts by defining them in the layouts
section of the configuration file and placing the corresponding Blade templates in resources/views/vendor/hyde-layouts-manager
.
Overriding Default Components templates
To customize components, publish the views and edit the files in resources/views/vendor/hyde-layouts-manager/components
.
Dynamic Branding (with shipped default MelaSistema layout)
Customizing the Navigation Brand
The navigation brand (logo) can be customized through the navigation.brand
configuration. You can use a text-based logo, an image logo, or a custom HTML logo. You can also configure the logo's behavior in light and dark themes. Below is an example configuration:
Customizing the Call to Action (CTA)
You can configure a CTA button in the navigation to link to an external URL or trigger actions. Below is an example configuration for the CTA button:
Customizing Social Media Links
Social media links can be customized to include icons that link to your social platforms. The configuration allows you to toggle the visibility of each platform (e.g., GitHub, LinkedIn) and adjust the icon colors for light and dark themes. Below is an example configuration:
Footer Customization
The footer can be customized to match your branding, colors, and content. You can set background and text colors for both light and dark themes, as well as modify the footer links and description. Below is an example configuration:
With these options, you have full control over the navigation brand, CTA button, social media links, and footer content, ensuring your site is fully customizable and reflects your brandโs identity.
๐ Credits
This project is made possible by the inspiration, contributions, and tools of an incredible community. A heartfelt thank you to:
-
๐จโ๐ป Author: Luca Visciola โ Passionate developer and creator of Hyde Layouts Manager. Reach out at [email protected] for inquiries or feedback.
-
๐ Inspired by HydePHP: The foundation of this project stems from the brilliance of Caen De Silva. Discover the magic of static site generation at HydePHP GitHub.
- ๐จ Boosted by Flowbite: This package features beautiful UI components and layouts, made even better with tools from Flowbite.
๐ Special Thanks
To the open-source community and all contributorsโyour dedication and collaboration inspire innovation and make projects like this possible. ๐
๐ License
This package is licensed under the MIT License. See the LICENSE file for details.
๐ Changelog
All notable changes to this project are documented in CHANGELOG.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
๐ก Contributing
We welcome contributions! Feel free to open an issue or submit a pull request on GitHub.
Support
If you encounter any issues or have questions, please open an issue on GitHub.