Hello, not sure if this is an Omega Issue or a DS issue but it's an issue that affects Omega none the less.
When using any DS layout I can't seem to get the classes to appear on the nodes ("node node-teaser" etc) that would usually appear there. I notice that with Omega 4 these classes are different than with other themes ("node node--page node--full node--page--full" is how they show up in Omega 4). This seems to be done in omega's hook_preprocess_node() located in node.preprocess.inc in the Omega base theme. I have tried other themes and the correct classes show up fine. I'm sure it's probably something simple but I haven't been able to figure out a tidy way of getting these to show up with Omega, does anyone have any ideas?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#8 | 2059819-8.patch | 1.08 KB | fubhy |
Comments
Comment #1
fubhy CreditAttribution: fubhy commentedYep, this is a known issue but I did not have time to look into it yet. It's not related to the node-specific preprocess hooks but is a problem with the
omega_initialize_attributes()
andomega_cleanup_attributes()
(omega) andds_entity_variables()
(display suite). They both basically do the opposite things and DS is being very mean here as it afterwards unsets() our classes which causes all classes to disappear :(. I would say this is something we should fix in DS as blindly unsetting the class attribute like that is just mean. Also, I am 100% pro-attributes-array as I absolutely hate "classes_array". I don't even understand why we have that. Attributes should be used everywhere (and that's what we are doing in D8 too) so my claim would be that "Omega does this right" at this point and we should probably fix this in DS. :)Not sure how we would fix that in Omega either... The whole switch to attributes_array is quite tricky (with that reference to classes_array to keep track of it, etc.).
Comment #2
freddybushboy CreditAttribution: freddybushboy commentedAh I see - very interesting! I have posted pretty much the same issue in the DS issue queue so I'm curious to see what people had to say over there too. I'll have to look into a temporary work around in the mean time though - I'll post anything I find here :-) Thanks!
Comment #3
swentel CreditAttribution: swentel commented@fubhy - I remember you showing me this one day, let's talk this over in IRC when we both have a few minutes :)
Comment #4
fubhy CreditAttribution: fubhy commented@swentel sure, will be on IRC in about an hour...
Comment #5
freddybushboy CreditAttribution: freddybushboy commentedLooking forward to hearing what comes of that chat. The temporary fix I am using at the moment for anyone who is interested is just to add the node classes to
$variables['classes']
intemplate_process_node(&$variables)
in my template.php. Not great but does the trick for now..Here is the code I used if anyone is interested - I copied a lot of it straight from omega:
Comment #6
fubhy CreditAttribution: fubhy commentedPlease use $variables['attributes_array']['class'] instead of classes and classes_array.
Comment #7
freddybushboy CreditAttribution: freddybushboy commentedI tried adding these classes using first the attributes_array and then the classes_array - for example
$variables['attributes_array']['class'][] = 'node';
Neither of these worked for me which is why I resorted to just adding it to
$variabless['classes']
Comment #8
fubhy CreditAttribution: fubhy commentedThis simple patch might solve the problem. Can you please test it? I did not have time to set up DS, etc. as I am leaving for a week of vacation :). If it works (and there are no other bugs introduced by this) please let @splatio commit it. Assigning to @splatio.
Comment #10
fubhy CreditAttribution: fubhy commentedI had some time to test this now. The patch seems to work nicely. I did not find any regressions whatsoever and the DS layout classes are rendered properly. Going to commit this. Can you please still test this in case I missed anything?
Comment #11
fubhy CreditAttribution: fubhy commentedCommitted 4555f2f
Comment #12
freddybushboy CreditAttribution: freddybushboy commentedThanks, I changed to the dev version, and it resolves my problem just fine :-) I am however getting this unrelated error with the dev version. I notice the libraries folder doesn't come with the dev version but I still had most of the files from beta6 - I just needed html5shiv-printshiv.js to resolve the second part and I am no longer using livereaload.js so I dont actually get the first part anymore - just a heads up.
Comment #13
fubhy CreditAttribution: fubhy commentedTake a look at the libraries.make file that now comes with the Dev release.use that to download the libraries properly. There is already an issue for the parse URL bug with livereload with a patch that fixes it.
Comment #14
freddybushboy CreditAttribution: freddybushboy commentedThanks :)
Comment #15
freddybushboy CreditAttribution: freddybushboy commentedThese are the classes I get now when using a DS layout for the record:
ds-1col node node-product node-teaser view-mode-teaser node--teaser node----teaser clearfix
Quite a lot of classes are added for the view mode and the
node----teaser
one is a bit odd, I'm guessing its the one that is supposed to be something likenode--node_type--view_mode
from line 26 in the file omega/preprocess/node.preprocess.inc ?Does that mean that this is still not working as intended?
Comment #16
freddybushboy CreditAttribution: freddybushboy commentedComment #17
fubhy CreditAttribution: fubhy commentedYep. I asked @splatio to take a look.
Comment #18
msmithcti CreditAttribution: msmithcti commentedSo I've tested this with the latest dev and the classes are working correctly. Have you pulled the latest version from Git? Have you cleared all caches? Are you able to reproduce this on a clean install with just Omega and Display Suite?
Setting this back to fixed. Feel free to reopen if you are able to give some clear steps for reproducing it.
Comment #20
karlmc15 CreditAttribution: karlmc15 commentedhi all brother
I'm apply this patch https://drupal.org/files/locale_file_exists.patch in threat https://drupal.org/node/1803330
and my site vnopsec.com fine :)
Comment #21
msmithcti CreditAttribution: msmithcti commented@karlmc15 - glad it is working for you.
Generally it is a bad idea to reopen an issue once it has been fixed unless you have an issue with the specific fix in that issue.
Please see [#156119] for guidelines on what issue statuses to use, as a general rule "patch (to be ported)" is the wrong status to use in 90% of situations.