Need help with Joomla? We are available for hire to help with Joomla customization, upgrades, maintenance, and custom development.
Explore our services

Adjusting Content Restriction Output in Blog Layout for Easier Customization

  • hide10
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
1 year 10 months ago - 1 year 10 months ago #168424 by hide10
Hello,

I am currently using Membership Pro with the "Hide fulltext from none subscribers" option to restrict article content. When displaying articles in a blog layout, the content generated by content_restricted_message is placed inside the <div class="item-intro">. However, for easier CSS customization, I would prefer this content to be output outside of the <div class="item-intro">.The current structure looks like this:
Code:
<div class="item-intro">     Intro text     <div class="text-info">         Content generated by content_restricted_message     </div> </div>


I would like to change it to:
Code:
<div class="item-intro">     Intro text </div> <div class="text-info">     Content generated by content_restricted_message </div>


I checked the files in plugins/system/osmembershiparticles/tmpl, but only found <p class="text-info"> instead of <div class="text-info">. Is there a way to achieve this adjustment through an override or any other method? Any guidance would be appreciated.
Regards
Last edit: 1 year 10 months ago by hide10. Reason: Remove automatically inserted [code] tags

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
1 year 10 months ago #168426 by Tuan Pham Ngoc
Hmm

Are you using latest version of the extension? If you are using latest version, the output should be controlled by the file components/com_osmembership/view/common/tmpl/restrictionmsg.php and it should work exactly as you want

Maybe you can check it on your site to see if the above file is executed ? Could add some text there to check

Tuan

Please Log in or Create an account to join the conversation.

  • hide10
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
1 year 10 months ago #168444 by hide10
Hi,

By overriding the template and modifying view/common/tmpl/restrictionmsg.php, I was able to achieve the desired outcome. By changing the code as follows, it became easier to apply CSS:
Code:
if (isset($introText)) {     echo '<div class="intro-text">' . $introText . '</div>'; } ?> <div class="text-info">     <?php echo $msg; ?> </div>

The above code results in the HTML being output as follows, making it easier to apply custom CSS:
Code:
<div class="item-intro">     <div class="intro-text">         Intro text     </div>     <div class="text-info">         Content generated by content_restricted_message     </div> </div>


Thanks

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
1 year 10 months ago #168446 by Tuan Pham Ngoc
Great. Thanks for sharing. I will check it more and might apply the same changes to the core package

Regards,

Tuan

Please Log in or Create an account to join the conversation.