Jump to content

[EasySocial] MyListings app with card layout


Jnnis

Recommended Posts

Good morning,

I want to share a modification we made yesterday to make use of the JReviews card layout features for listings in EasySocial apps. See 

 

@Alejandro gave us the starting point a few days ago. So at first you should create a template override for 

components/com_jreviews/jreviews/views/themes/default/community_plugins/community_mylistings.thtml

which will be placed in

templates/jreviews_overrides/views/themes/{customtheme}/community_plugins/community_mylistings.thtml

 

We compared this file for rendering the listing in the MyListings app from EasySocial with the card layouts file which is located here:

components/com_jreviews/jreviews/views/themes/default/modules/listings_card.thtml

 

In the JReviews Backend you can make use of the layout customizer and create your own layout for modules which you can select in a module or make use of in shortcodes by setting the id. We did not integrate the layout customizer because of missing knowledge how to. So we just looked in the backend which settings we would like to set hard coded. This means:

  • $listingListLayoutSettings is not available in the code

  • $settings array is checking if information can be taken from $listingListLayoutSettings. if these information are not available ("??" means is set) a default value is definied. For example:

    	'imagePosition' => $listingListLayoutSettings['imagePosition'] ?? 'left' // left, right, top
  • You can pick the information from a layout in the JReviews backend and set them in your code until we find a community-way to get them dynamically. 

 

I attached you an example of our file override. We deleted the slideshow feature cause we did not use it. Best way is to compare the attached file with the both named files above to see the differences.

This is a very first quick & dirty solution and perhaps together we could build an even better version of the whole app with the possibility to make use of the settings in the EasySocial app.

 

community_mylistings.thtml

Link to comment
×
×
  • Create New...