qubeshub / plg_groups_publications

Publication plugin for groups component,
0 stars 0 forks source link

Implement card view... #7

Closed mdlama closed 5 years ago

mdlama commented 6 years ago

...and make this the default.

mdlama commented 6 years ago

Starting in publications.php @ line 398 of 3dc83ed374f390a65d83888fd47544c5ec1ac435

// Instantiate a vew
$view = $this->view('default', 'results');

This calls views/results/tmpl/default.php. Creating cards.php and changing this line. Note that css and js technically should be in com_publications as, technically, we would want to use this same view there as well, which is important for code reuse.

mdlama commented 6 years ago

Making progress!

screen shot 2017-11-18 at 3 08 09 pm
mdlama commented 6 years ago

Probably not best practice (i.e. this is a separate issue), but (1) moved publication area to 'correct' location, (2) changed icon, and (3) added counter.

pubarea

Documenting useful info about plugins here.

mdlama commented 6 years ago

Attempting to use macros. My question to Shawn:

Question: Can I call a macro from another extension, like a plugin? I found /Plugins/Content/Formathtml/Macros/Macro::getInstance(), but wasn’t sure if that would work — the $config argument doesn’t seem to accept arguments. Although I think I can just add the arguments like $macroinst->args = array("group" => "thisgroup"), for example. Thoughts? Sorry, /Plugins/Content/Formathtml/Macro::getInstance()

Shawn's reply:

You can directly include a macro file if you know the absolute path but there is generic utility for triggering macros like plugins are triggered (e.g., Event::trigger('type.onEvent');).

The only config arguments Macro::getInstance() accepts is related to the class name for the desired macro to be loaded. Otherwise, it assumes the name follows a pre-determined pattern.