Category in Override: Plans List Default Layout

  • reilldesign
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 9 months ago #144616 by reilldesign
Hi Tuan,

is there a way to echo (php) the category alias of a plan in the container class of div.osm-item-wrapper. We are using the menu view »Plans List Default Layout«.
We are plannig to use the filterizr javascript plugin to filter the plans. So we need the category alias as filter. Example: <div class="osm-item-wrapper yoga-tutorials">...</div>

Regards Peter

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

More
2 years 9 months ago #144624 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Category in Override: Plans List Default Layout
Will Category ID works? Or Category Alias is a must?

Tuan

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

  • reilldesign
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 9 months ago #144638 by reilldesign
Replied by reilldesign on topic Category in Override: Plans List Default Layout
Hi Tuan,

a unique category id works. The final code would:

data-category="1" data-category="1" >...</div>

where "1" is the category id.

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

More
2 years 9 months ago #144645 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Category in Override: Plans List Default Layout
Hello

Please get this file, unzip it, upload the received file to folder components/com_osmembership/view/common/tmpl to see if it works. If Yes, you can move the modified file to PATH_TO_TEMPLATE/html/com_osmembership/common folder so that the change won't be lost when you update to future releases of the extension

Regards,

Tuan
Attachments:

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

  • reilldesign
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 9 months ago #144647 by reilldesign
Replied by reilldesign on topic Category in Override: Plans List Default Layout
Hi Tuan,

thanks a lot for the quick reply. I missed to do a var_dump($item);

<?php echo $item->category_id; ?> is perfect!!!

As a feature request the vars »category_title« and »category_alias« would be handy for overrides.

Thanks a lot
Peter

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

More
2 years 9 months ago #144648 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Category in Override: Plans List Default Layout
You can only get that data yourself if needed. Something like:
Code:
if ($item->category_id) { $category = OSMembershipHelperDatabase::getCategory($item->id); echo $category->title; echo $category->alias; }

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

  • reilldesign
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 9 months ago #144673 by reilldesign
Replied by reilldesign on topic Category in Override: Plans List Default Layout
Hi Tuan,

it only shows the name of the first item category and ignores the following items.

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

More
2 years 9 months ago #144685 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Category in Override: Plans List Default Layout
Sorry. There was a typo. The code should be:
Code:
$category = OSMembershipHelperDatabase::getCategory($item->category_id); echo $category->title; echo $category->alias;

Please try again with that new code.

Tuan

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