You can easily add a custom row to the homepage in Smartend CMS by following these steps:
Step 1: Create a Row File
-
Navigate to the directory:
/core/resources/views/frontEnd/homepage/
- Create a new view file for the custom row and name it (e.g., `row99.blade.php`).
- To simplify, you can duplicate an existing row file that closely matches your desired layout from the same directory. Rename it to `row99.blade.php` and modify the source code as needed to fit your design and content.
Step 2: Include the New Row on the Homepage
-
Open the file:
/core/resources/views/frontEnd/home.blade.php
-
Include your new row file using the `@include` directive where you want it to appear. Example:
@include('frontEnd.homepage.row99');
-
Position your new row according to your desired layout. For example, to place it after the FAQ row,
structure it like this:
@include('frontEnd.layouts.slider');@include('frontEnd.layouts.row1');@include('frontEnd.layouts.row2');@include('frontEnd.layouts.row3');@include('frontEnd.layouts.row4');@include('frontEnd.layouts.row5');@include('frontEnd.layouts.row99');@include('frontEnd.layouts.row6');@include('frontEnd.layouts.row7');
By following these steps, you can seamlessly add and manage custom rows on the homepage of your Smartend CMS website.
Extra Useful Tips for Customization
You can dynamically retrieve and display content from any site module within your custom row layout. This allows you to seamlessly integrate various types of content, such as blog posts, products, or team profiles, directly into the homepage. Additionally, you have the flexibility to enhance the appearance and functionality of the custom row by adding tailored CSS styles or JavaScript code. By doing so, you can ensure the new row aligns perfectly with the overall design and provides any interactive features or custom behavior required to enhance the user experience.
Fetch Dynamic Content for the Row
To pull content from any module or site section, use the `Helper::Topics` method as shown below:
$Topics = Helper::Topics($ModuleID, $CatId, $ItemsLimit, $RandomOrder);
Example:
To retrieve the latest 12 posts from the blog module:
$BlogPosts = Helper::Topics(7, 0, 12, 0);
You can then loop through `$BlogPosts` and display the data within your HTML layout using Bootstrap 5
classes for responsive design.
Add Custom CSS for the New Row
If your new row requires custom styling, you can use the `@push` directive to insert CSS:
@push('after-styles')
// Your custom css code here
@endpush
Add Custom JavaScript for the New Row
If your new row needs custom JavaScript functionality, use the following:
@push('after-scripts')
// Your custom js code here
@endpush