New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/script tag #1259
Feature/script tag #1259
Conversation
As use the Stylesheet library to serve JavaScript feels weird, I duplicated and renamed it to Assets. I guess, the original can be converted into a proxy to the new one, to keep it available to addons developers. However, I've no idea on the better path to take. |
082760f
to
976f5fd
Compare
I don't like duplicatig the code - I think we need to be as DRY as possible. I think it's better to have something like Maybe this would be good chance to take this code out of |
@intoeetive , do you mind help me a little more with the right places and naming conventions? Should I create an Assets Library? Is that fine? |
I think making this change is combination of adding new feature with code refactoring. We generally try to avoid adding stuff into So if I would be you :) I'd probably do something similar to this:
Again, this is just how I personally view things here. I admit it can be approached differently as well |
3c1d906
to
d13d1c2
Compare
Yes, something along those lines should be fine (please also try to avoid force-pushing, that makes merging more difficult) |
I'm sorry it have been taking so long, @intoeetive . Not even being an important feature for me, I've not found time enough for. While working, I've found a bug which should not have to wait for me to be fixed! The /** -----------------------------------------
/** Retrieve template file if necessary
/** -----------------------------------------*/
if (ee()->config->item('save_tmpl_files') == 'y') {
ee()->load->helper('file');
$basepath = PATH_TMPL . (
isset($site) ? $site : (ee()->config->item('template_folder') ?: ee()->config->item('site_short_name'))
) . '/';
$basepath .= $group . '.group/' . $row['template_name'] . '.' . $this->type;
$str = read_file($basepath);
$row['template_data'] = ($str !== false) ? $str : $row['template_data'];
$row['edit_date'] = ($str !== false) ? filemtime($basepath) : $row['edit_date']; // this line is missing!
} Without that last line, the submitted date is from database, not saved files. |
I'm sorry, @intoeetive . I proved myself a total newbie PHP developer. I've saved my files in the right places, but I couldn't make them to work. |
I'll try to go with it. Can't promise when that will be happening though |
I'm sorry, @intoeetive . And thank you! |
I did it, @intoeetive ! It worked! |
2d71a68
to
2d6a648
Compare
@intoeetive , π₯π₯π₯? |
2d6a648
to
8fa083d
Compare
I looked through the code, and I think you did awesome job here. I did not check every tiny bit, but it does look very good to me. However we need to have some automated tests written to accept this - do you happen to have sample template code, or add-on code, that's utilizing this new code and that we can use to test? Also in few places there need to be spaces around Thank you very much! |
Tests added! The same tests can be used to test the |
I guess I should add tests for trigger words on URLs, like |
Now I've a problem. To add |
Adding |
Options I have:
Options 1 and 3 would make template type trigger words to be considered almost as a to-be-deprecated feature. In any case, |
I've never used the "trigger word" feature myself, so don't know how important it is. My vote is option 1. |
684629d
to
395d2f3
Compare
cecaebf
to
f60e6ce
Compare
tests/cypress/cypress/integration/design/template_of_resources.ee6.js
Outdated
Show resolved
Hide resolved
β¦ a bug where the tag wasnt being parsed the first time it is called
I have fixed the tests. Letting you guys handle everything else! |
Overview
It implements:
{script="group/template"}
{stylesheet="site:group/template"}
Resolves #1246.
Addresses #1220.
Nature of This Change
Is this backwards compatible?
Documentation
User Guide Pull Request: ExpressionEngine/ExpressionEngine-User-Guide#232