Moc / cookbook

Important: NOT READY FOR RELEASE YET!! A fully featured Cookbook plugin for e107, for all your recipes. Includes functionalities such as categorization, sharing, and bookmarking.
Apache License 2.0
2 stars 3 forks source link

edit button and bookmark, print #18

Open Jimmi08 opened 2 years ago

Jimmi08 commented 2 years ago

Motivation

    /* {COOKBOOK_EDIT} */
    function sc_cookbook_edit($parm='')
    {
        if(check_class(e107::getPlugPref('cookbook', 'submission_userclass')))
        {
            $link = e_PLUGIN_ABS.'cookbook/admin_config.php?action=edit&id='.$this->var["r_id"].'';
            return '<li><i class="fa-li fa fa-pencil"></i> <a href="'.$link.'">'.LAN_EDIT.'</a></li>';
        }
        return;
    }

Proposed Solution

Could you add parameter or move<li></li>to template? When you want to use edit button separately withou <ul></ul>

image

correct icon

Could you use core solution for glyphs? Your fa-pencil is not displayed in bootstrap 5 theme

Quick fix: fa-edit is working

Jimmi08 commented 2 years ago

This was needed for bootstrap5:

                  <ul >
                    <li class="d-inline">{COOKBOOK_BOOKMARK}</li>
                    <li class="d-inline">{COOKBOOK_EDIT}</li>
                    <li class="d-inline">{COOKBOOK_PRINT}</li>
                  </ul>

so li tags shouldn't be in those shortcodes

Jimmi08 commented 2 years ago

What was needed: Add parameter class for each button for a tag Add parameter icon - if it is possible, or add them as prefs - when you don't want to use FA icons Add parameter to use just icon not text

with bookmark - icon is inside a tag (correct), with edit and print it is before a tag

image

Moc commented 2 years ago

@Jimmi08 Could you test again with the latest version and see if the EDIT and PRINT shortcodes are fully customizable now?

I still need to do some work on the bookmarks button, but not sure yet how to approach it (because it changes depending on whether a recipe is bookmarked or not).

Moc commented 1 year ago

@Jimmi08 I have made some changes that should allow to template the bookmark functionality properly now. I'm still not really happy with the functionality but happy to hear your findings. For me, there's some weird refresh/moving behaviour going on, when clicking the add/remove link.