Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Can anyone give me the low-down on the prescribed protocol to manipulate the html (add attributes like 'data-role="listview"')? Should I just be editing the .tpl files, add it with javascript, or using a hook in the template.php file?
In other words, I want to be able to use jquery mobile to theme more then just the menus, header, and footer.
Thanks for any thoughts on the subject. I'm extremely excited about this module and all the work that's gone into it.
Scott
Comments
Comment #1
skhot CreditAttribution: skhot commentedWell so far I've tried creating a custom views-view-list.tpl.php file and added the 'data-role="listview"' like this:
<<?php print $options['type']; ?> data-role="listview" data-filter="true" >
No dice.
I also tried using this hook:
No dice.
Anyone?
Comment #2
skhot CreditAttribution: skhot commentedI at least get a response from the output with the jQuery method, though the results do not match what I was expecting (or how jqm docs work. I put this in sites/all/themes/mobile_jquery/scripts/script.js. It seems to be getting out of control. I would still appreciate if someone could point me in the right direction.
Comment #3
jasonsavino CreditAttribution: jasonsavino commentedI was able to make a view of articles and have them display in jquerymobile listview.
To do this I did the following:
1. Create a view of article type content using full nodes but in teaser display mode
2. modified the views-view-list.tpl.php
3. changed the teaser display mode for the article content type to show only the body (hiding everything else)
4. duplicated the node.tpl.php file and named it node--article.tpl.php
5. modified the node--article.tpl.php file by changing the line 81 from:
TO:
6. Cleared cache
From there I was able to display the new view page and click through to the nodes without issue.
If this works for you please let me know so I can close the ticket.
Cheers,
Jason
Comment #4
skhot CreditAttribution: skhot commentedThanks! This worked great. I'm theming all over the place. Also, I appreciate the hide contextual menus/comments tip in 3-5.
Comment #5
jasonsavino CreditAttribution: jasonsavino commentedComment #6
ideafarm CreditAttribution: ideafarm commentedCheck out http://drupal.org/project/views_jqm