Closed (duplicate)
Project:
Lost & found issues
Component:
Twig templates conversion (front-end branch)
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
9 Sep 2012 at 00:47 UTC
Updated:
27 Jan 2013 at 00:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
vlad.dancerMoved code from theme_toolbar_toggle() to preprocess_toolbar_toggle()
Comment #2
podarokno tabs! use whitespaces!
Comment #3
vlad.dancerComment #4
podarokgood work!
thanks
Comment #5
podarokpatch does not apply against latest merge_chx_sandbox branch
need reroll
Comment #6
podarokwoops
status
Comment #7
podarokcommited #3 into 8.x branch
Comment #9
fabianx commentedRe-opened as it was not merged to front-end branch, yet and removing theme functions should probably not be done.
@jenlampton: Could you take a look at the patch and ask author to re-roll properly?
Best,
Fabian
Comment #10
vlad.dancer@fabianx
There is one thing that i don't know how to resolve it.
Currently, as doc at pixelmord sandbox said: "Don't remove theme func", becouse we want to use theme func. in another phptemplate themes. And in current toolbar_toolbar i want to define "template => link" for twig equivalent link.twig (template consolidation), but when i do, phptemplates try to fing link.php.tpl and of couse there is no such template) ?
What should i do? Maybe there is existing discussion about it?
Comment #11
fabianx commentedThis will be resolved soon as we move all our work over to the modules directly.
We are that far in core now :).
http://drupal.org/node/1696786#comment-6576850
And the template => 'file' seems to work fine even if another theme is used, but needs more investigation.
Comment #12
vlad.dancerThx for information.
It seems in front-end branch i got this error when do one.
Warning: include(): Failed opening 'core/modules/toolbar/link.tpl.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in theme_render_template() (line 1418 of core/includes/theme.inc).
Comment #13
vlad.dancerI found solution to make this theme func. working with both engines.
Replace implementation of toolbar_toggle render.
Before:
After:
From toolbar_view() (this code is transitional stage of removing renderable arrays)
It's ok when this link renders in phptemplate, but in twig there are errors. This errors comes from link.twig!
Becouse in theme_link we doesn't have $variables['attributes'] unlike in link.twig!
So question is where this error will be fixed? In theme_link or link.twig?
Comment #14
vlad.dancerComment #15
vlad.dancerThis patch add new variable for link also fix problem from comment #9. But it throws errors in phptemplate themes.
Also this theme_toggle_toolbar is point where we need to add new Attributes.
Also if we would remove drupal render style from toolbar_view() we could replace theme_toolbar_toggle by theme('link__toolbar_toggle', $vars);
Comment #16
podarok#15 looks good for me
but before commit we should decide what to do with "not found" *.tpl.php templates in such cases
Comment #17
podarok#15 commited / push to front-end
Thanks!
Comment #18
jenlamptonthis file is stil missing from the front-end branch, can you push again?
Comment #19
podarok#18 what file?
Comment #20
jenlamptontoolbar-toggle.html.twig is not in the core/themes/stark/templates/toolbar directory.
I expect that this patch was committed and just not pushed?
Comment #21
podarok#20
we are not using toolbar-toggle.html.twig
we are using link.html.twig here http://drupalcode.org/sandbox/pixelmord/1750250.git/blob/5d7dd04f00eff12...
Comment #22
podarokstatus
Comment #23
jenlamptonAh, okay. Then we'll need a temporary file that includes link.html.twig instead with a @todo and a link to the core issue #1595614: [meta] Remove all the theme functions and templates in core that simply output a link. Replace with #type 'link' render arrays
See textfield.html.twig for an example of how this is done - but the Twig template should look something like this:
Comment #24
vlad.dancerAdded
- temp template
- new template name to theme func in hook_theme
- added @todo in template
Comment #25
podarok#24 commited / pushed to front-end
Thanks!
Comment #26
jenlamptonThere are still a few problems with the file in the front-end branch:
- missing available variables in docblock
- missing include (still shows anchor tag?)
comments on anchor tag (though about to be removed)
- whitespace controllers around classes (they should never be on classes)
- missing whitespace controller on left of attributes (should always have one on attribtutes)
It looks like this line was just copied from link.html.twig, so I'll update that file too. Sorry for the confusion.
Comment #27
jenlamptonJust for reference, I updated the template file in front-end to be the following:
Comment #28
steveoliver commentedThis is unnecessary. Let's do like #1595614: [meta] Remove all the theme functions and templates in core that simply output a link. Replace with #type 'link' render arrays and use theme('link') instead. ... Patch coming up.
Comment #29
vlad.dancerThanks for #26, 27!
About 26. Thx a lot for your job! I think there is no difference now either copy code from link template or use include (if this situation temporary and we want replace template by theme('link'))
About #28 - there is no room where we can easy call
theme('links'), actually - there is, but also we need refactoring of render arrays output style (see comment #13).Previous method that i supposed was add
'template' => 'link'Comment #30
steveoliver commentedThis is what I'm talking about (attached).
Depends on #1 in #1825820: theme('link').
Comment #31
steveoliver commentedLast patch was missing an important line that switched the toolbar-active class on and off.
To the point:
1. Apply this from #1825820: theme('link')
2. Apply this from #1825828: theme('toolbar')
3. That's how I think toolbar should work.
Sorry for all the posts. I'm trying to keep patches on their own topics.
Comment #32
podarok#31 please better use
[#topicID-commentNUM]as#1779104-31: Convert theme_toolbar_toggle to twigfor Your comment to point to right place(issue node + comment) of a patchComment #33
steveoliver commentedWill do, podarok.
Comment #34
podarok#33 what is here to review?
i`d lost myself :(
Comment #35
steveoliver commentedpodarok: see #1825828-3: theme('toolbar') for full patch for toolbar.
Comment #36
podarokbad comment
sorry
Comment #37
steveoliver commentedThis patch removes
theme('toolbar_toggle')and replaces it intheme('toolbar')with an implementation oftheme('link').It fixes the toolbar toggle issue I noticed (Hide shortcuts and Edit shortcuts links).
Before:
After:
Comment #38
steveoliver commentedPatch would be helpful.
Comment #39
jessebeach commentedHi all, I just wanted to mention that the toolbar theme issues are being addressed in the responsive toolbar patch. I just switched from tpl to twig in the latest patch.
#1137920-282: Fix toolbar on small screen sizes and redesign toolbar for desktop
I would suggest closing this issue as a duplicate or at least postponing it. I'd like to avoid you all spending time on unnecessary work here.
Comment #40
fabianx commentedComment #41
johnnydarkko commentedAdmin Toolbar overlay isn't showing in stark.
Comment #42
johnnydarkko commentedAccidentally reopened this one... meant to post the previous comment on #1825828: theme('toolbar')