Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. Ahh sorry now I see it does some saving of the page (post). If I change the title it does show on preview without saving.. but it doesn't seem to work always only every 2th time? There's something strange that's why I assumed it doesn't save. Also will this approach work with when there's some logic happen in the template view to show something based on the pages id or childs?
  2. Nico thanks for the update! I just gave it a try. But... Do you know that the "view" button of PW does actually same as this module? Any logged in user that can edit/view a page can also "view" it even if the page is unpublished. I didn't knew that for some time. So this module could just add a target='_blank' attribute to the "view" tab and do the exactly same. The other thing is: This module doesn't do what I expect from a "preview" module. I would assume that when I want to "preview" a page I'm editing, that it works without saving the page actually. I guess there would be the need to have a more complicated process going to get this work. I can't think of any atm. But I'm sure there is one. After testing you module, there was an issue when I click preview, it opens new window. I close the window, and when I click "save" it open 1-2 Windows again with the preview. I close them and still the same. I need to reload the page to get saving to work.
  3. Hey welcome to the forums moose. Glad you figured it out yourself. Just wanted to inform that my darknight theme isn't currently on latest PW. It needs some adaption, since there's some new things introduced like multilang admin, and field cols. Possibly that there's some issues.
  4. I don't think you want to take that route, as it is used by many things, mostly javascripts. Too much, if you ask me, to change. Not sure. Changing host is the best solution. Or maybe there's a workaround to implement that functionality using a class, but not even sure if that would work.
  5. Since I don't know when, I got problem with the TinyMCE setting table attribute to 100%. The attribute get's stripped off when saved. All other attributes work. Anyone have same issue or know how to fix it? I'm sure it worked before. So maybe this has to do with the new TinyMCE version 3.4.7? This is the valid_elements: @[id|class],a[href|target|name|title],strong/b,em/i,br,img[src|id|class|width|height|alt],ul,ol,li,p[class],h2,h3,h4,blockquote,-p,-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],code,pre,sup Doing this it works setting it always to 100%: ...-table[border=0|cellspacing|cellpadding|width=100%|frame|rules|height|align|summary|bgcolor|background|bordercolor]... Solution: add the "style" attribute to the valid elements, as TinyMCE converts the width="100%" to style="width:100%". To allow it for all add it to @[id,class|style] or just the table elements.
  6. You think? Then your second example wouldnt work either. You can add include=all and it will ignore permissions.
  7. Then he's second example wouldn't work either I guess.
  8. I am also using latest PW. But I guess you haven't turned on debug mode, that's why you don't see the warning it. It may still be working, haven't really tested further. It's always confusing with those warnings. Sorry, changed title.
  9. Congratulations! Thanks to all.
  10. It works normally here as it should. Can you provide more details, where and how you're using it?
  11. Have you made your date field "autojoin"? Without setting it you cant sort by the field. On a side note, formatted dates can be sorted using "Y-m-d". For example in a sortable table.
  12. Alan, this seemed to be true for 2.0. I think. I would search with site:processwire.com permission page-edit https://www.google.c...iw=1352&bih=850 Mainly it's simple and straight forward. If the module has no "permission" set only superuser will see it. If it has a "permission" the user has assigned to one of he's roles he will see the page in the admin. So "page-edit" is a possibility, but not the only solution. If one creates a module (look at AdminBar) he can decide to give it for example a "adminbar" permission, so it can be used for site admin to give access to only certain users using that permission. Edit: So far this is mainly for advanced module developement, which isn't covered anywhere yet, but will in the near future.
  13. MarkupLoadRSS, I get this warning: Strict Standards: Declaration of MarkupLoadRSS::error() should be compatible with that of Wire::error() in /.../htdocs/pw-dev/site/modules/MarkupLoadRSS.module on line 143 with module MarkupLoadGCal: Strict Standards: Declaration of MarkupLoadGCal::error() should be compatible with that of Wire::error() in /.../htdocs/pw-dev/site/modules/MarkupLoadGCal/MarkupLoadGCal.module on line 25
  14. Alan, for non superuser to see the custom admin page, the module requires a permission set in getModuleInfo static method: simplest would be to add: "permission" => "page-edit" you could also create a custom permission and add that to the roles you want them to see the admin page.
  15. Permissions are text based. While there's some already there used by system, you can simply add custom permission you then can use for your module or in templates: $user->hasPermission("mypermission")
  16. welcome to the forums yellowled. yes everything is threated as pages. I don't think certain types stored as xml or json will not make it more performant than mysql, rather opposite. If a page exists only to store informations that the can be pulled form anywhere is a good way. It doesn't even need to have a ".php" template attached if that's page never going to be viewed anyway. You can of course have data as pages that will get displayed through other pages. One way to display it is using code in the page template that will render the data, so in the foreach you have something like a markup generating code. FOr example often used is something like this. if(count($page->children('template=member'))){ foreach($page->children('template=member') as $m){ echo "<div class='box'>"; echo "<div class='image'>"; echo "<img src='{$m->image->size(200,0)->url}'/>"; echo "</div>"; echo "<div class='text'>"; echo "<h2>{$m->title}</h2>"; echo "<h3>{$m->member_function}</h3>"; echo $m->member_descr; echo "</div>"; echo "</div>"; } } Or other ways of doing it, as you like. Another possibility would be to have a member.php that will contain the markup and then can be rendered using the $page->render(); in the member.php: <div class='box'> <div class='image'> <img src='<?php echo $page->image->size(200,0)->url ?>'/> </div> <div class='text'> <h2><?php echo $page->title ?></h2> <h3><?php echo $page->member_function ?></h3> <?php echo $page->member_descr ?> </div> </div> then the previous would be like this: if(count($page->children('template=member'))){ foreach($page->children('template=member') as $m){ $m->render(); } } There's not "right" way, just what you like most and would make sense in your situation. There many many ways to build it. EDIT: corrected some code...
  17. Soma

    joaovieirasantos

    ... and I thought you were really that bad!
  18. This is just the data table of the field. field_x table. The fields table holds the information (title etc) of the field and has flags column. If the field is not attached to any template there will be no relation entry in the fieldgroups_fields. So you could next go to the fields table and delete the field you want to delete. Then the data table of the field itself (field_xxx).
  19. What "flags" do they have that don't show in the admin field list? Are they used in any fieldgroup? You can delete them manually, in the tables fieldgroup_fields first (look for id) and fields table, then the table of the field itself field_x. Edit: Though I also after excessive coding, trying got this issue ones, I delete the table and it's references manually. BUt maybe would be good to know what the problem could be that this happens.
  20. NO it's not Most likely it's due to some excessive trying... If you delete a field the table will get deleted too.
  21. Could it be that the field is system thus not visible by default. Try setting the filter to show system fields too.
  22. I think this implementation is working well. Anyone? Since Ryan has done some recent changes to the inputfieldTinyMCE and added Codemagic to the core TinyMCE folder, we'll have to first sort this out. I told Ryan it may be best to put Codemagic not in core, since it will be hard to add translation to it this way. I haven't tested yet if the translation of Third-Party plugin would work with my method here of adding it externally via the field configuration. But this way one could add the necessary [lang].js to it. Anyway anybody interested in helping out testing/doing?
  23. Hey 12345j, are you still here? I just tried this out and fixed a bug with "$config" should be $this->config in modules. Mind if I put this on my github account? Edit: I just added a configuration setting, for defining the html tag the js script will get prepended to. Right now it will be prepended to the </head>, which might not where one wants to have it. So I added a text field where you can for example use "</body>" instead. Edit: Ok I just went and created a git repo with the updated version of this module. I also renamed the module to EmailObfuscator: https://github.com/s...EmailObfuscator
  24. You could try something like this: function Pagefields(Page $page){ $fielddata = new PageArray(); foreach($page->uses as $p){ foreach($page->get($p->name) as $fo){ if($fo->get($fo->name) && count($fo->get($fo->name))){ foreach($fo->get($fo->name) as $f1){ $fielddata->import($f1); } } else { $fielddata->import($fo); } } } return $fielddata; } foreach(Pagefields($page) as $p){ echo "<p>$p->title</p>"; }
  25. I tried and can confirm. Ryan? Adding a tabfield right after the 2 floated fields it breaks.
×
×
  • Create New...