Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Ah, now I see there's a change in my local MarkupSimpleNavigation module I did and haven't committed. So when using my code exmple with 1.1.9 it throws this error: Error: Exception: Method MarkupSimpleNavigation::___getItemString() does not exist (in /Applications/XAMPP/xamppfiles/htdocs/pw2-dev/wire/core/HookEvent.php line 153) #0 /Applications/XAMPP/xamppfiles/htdocs/pw2-dev/wire/core/HookEvent.php(153): ReflectionMethod->__construct(Object(MarkupSimpleNavigation), '___getItemStrin...') THere's a hook function I added which doesn't exist in current latest version, so it doesn't work. If you'd told me the error it would've been easy... I updated my code example and will delete your code to keep this thread cleaner.
  2. When searching pages with images field, there's no subfield "name" for images, but you can use images.data. And you won't get the image but a page(s) $p = $wire->pages->get("images.data%=mode"); // get return the first match echo $p->images->get("filename%=mode")->url; Or $p = $wire->pages->find("images.data=modelifestyle.jpg")->first(); // returns a pagearray and we access first echo $p->images->get("filename%=mode")->url; Or echo $p->images->get("name%=mode")->url; Or echo $p->images->find("filename%=mode")->first()->url; Or echo $p->images->get("modelifestyle.jpg")->url; Or echo $p->images->get("modelifestyle.jpg")->name; // image name or echo $p->images->get("modelifestyle.jpg")->filename; // full path
  3. Ah subdirectory... but then it should work as is. Do you have the latest version of the module?
  4. I can update and unupdate without problems between stable and dev. There's been quite some changes now from stable to dev, but none that caused any major problems so far. But maybe if you're installing and uninstalling language support modules along with that, it can screw up things, but even that I've been doing all the time with my test install and it's still running fine. Maybe if you could tell what went so horribly wrong, we can tell you more.
  5. Well apart from I don't know "what does not work" ... as I can't see your screen from here... Looks like you don't render the menu from the root level, although you don't give another root page to the nav render, so makes no sense to me. <li class="dropdown"><a href="/corpetrol/programas-tecnicos/">Programas Técnicos</a> This should be the first level dropdown, and it's missing the class and data attribute, but the URL is showing it's not a root page but a second level page already. So the hooks check for the level and since you seem to be on another level you'd have to change that to fit you structure. Those are the count($item->parents) if($item->numChildren(true) && count($item->parents) < 2){ ... } // only on level 1 I guess you have to adapt those.
  6. As I wrote the example is for Bootstrap 2.3.2. I have no idea what BS 3.0 needs... but I'm lucky I don't use Bootstrap because it's annoying
  7. @hosrt yes it works as usual/normal.
  8. No there's no image created and it silently fails, means code after doing the image doesn't get executed at all. I tried locally and it works, so it's the server I'm working on... although it's php 5.3 and GD 2...
  9. $pages->delete($page, true); http://cheatsheet.processwire.com/?filter=delete
  10. http://processwire.com/talk/topic/696-quick-guide-to-the-comments-system/page-3
  11. Ok I have it corrected but still it doesn't work. No error, no new image created. $p = wire("pages")->get(1111); echo $p->image->url; $img = $p->image; $pim = $img->pimLoad("bright")->contrast(100)->brightness(100)->pimSave(); echo "<img src='$pim->url'/>";
  12. Hehe, such a difficult API! Thanks guys!
  13. Thanks for the hard work here Horst! Looks like a very useful and good implementation. I'm in need of such a tool right now and I can't get it to work. When calling this in a template I get this error. site/assets/files/1111/source_gartenidylle_031007_151328.jpg Fatal error: Exception: Method Pageimage::imLoad does not exist or is not callable in this context (in /xxx/dev.urlich/wire/core/Wire.php line 320) #0 /xxx/html/dev.urlich/site/templates/home.php(32): Wire->__call('imLoad', Array) #1 /xxx/html/dev.urlich/site/templates/home.php(32): Pageimage->imLoad('bright_', Object(Pageimage)) #2 Code is this: $p = wire("pages")->get(1111);echo $p->image->url; $img = $p->image; $pim = $img->imLoad("bright_")->contrast(100)->brightness(100)->pimSave(); The module is loaded and the hook should be added (according to debug admin info) but the error suggests not? I tried with loading the module but then I get another error. /site/assets/files/1111/source_gartenidylle_031007_151328.jpg Fatal error: Exception: Cannot load the MemoryImage! (in /xxx/dev.urlich/site/modules/PageImageManipulator/ImageManipulator.class.php line 1216) #0 /xxx/dev.urlich/site/templates/home.php(32): ImageManipulator->contrast(100) #1 I have no idea what could cause the problem, maybe it's just me and the server. Some minor things: - Your modules code has tabs and space indents mixed. Something I'm aware of because I use SublimeText2 and It does what it automatic. - I found the name "PageImage" inconsistent to the core which uses "Pageimage". - I get a Warning: Invalid argument supplied for foreach() in /xxx/dev.urlich/wire/modules/Process/ProcessModule/ProcessModule.module on line 671 on module screen of PageImageManipulator
  14. Example: render multilevel navbar dropdown for @twbootstrap with MarkupSimpleNavigation in @processwire #cms http://t.co/T1u2e3tAjf

  15. Here I did an example for creating a Boostrap 2.3.2 Multilevel Navbar with MarkupSimpleNavigation https://gist.github.com/somatonic/6258081 I use hooks to manipulate certain attributes and classes to li's and anchors. If you understand the concept you can do a lot with these tools.
  16. RT @SublimePackages: ProcessWire Snippets - Basic: No description provided http://t.co/FOxP7iGpXM

  17. Hahajaja guys I'm just kidding. I'm just talking about listen to music. No music doesn't mean absolute silence. Absolute silence can feel odd but as long as there is noise around it doesn't count as silence. I also can better if there is some natural noise going and I mostly feel focused when working at night with some zzirps doing their singing outside its like meditation. But certain music just distacts when doing complex work. I also listen to music when doing easy work.
  18. I've read this slowly several times now and couldn't understand what it's about really. Can you explain differently what this would do?
  19. and install the autocomplete inputfield for page field for even more awe.
  20. You can make a simple WireData module to put functions specific to your project you can do all sorts of things like hooks, your own helper markup generating functions for use in template or other modules, or whatever else. See the HelloWorld.module that comes with the default profile. It comes down much to preference but I do that often, and instead of including a functions.php in template it will be available everywhere. You could even go as far as setting a new API var for use in the system. In the init() of such a autoload module you would call: $this->set->fuel("projects", $this); And you'd have a $projects API var that you could call methods from your class. Or set properties to existing API vars to maybe have a $user->fullname. Possibilities are endless.
  21. BTW, you can also you repeater to fill a page field select. They're also just pages at the end and I've done exactly that in a complex setup. Together with the custom php code you can define in the field settings you can do some pretty elegant magic happening. For example filling the select depending on the hierarchy or template you are editing the field.
  22. Actually you don't have to use page for everything, usually it's ok, but I myself use the static select for defining a color. Depends what the select really is for but if it's just for a setting you'll never use anywhere as pages really it's ok too. I setup a color select and the value is also the css class name so it's as easy as: <?php echo "class='$page->color';?> Also for status setting where you possibly need more than just a checkbox it can make sense to use a static select. So as a rule I try to think ahead what that select really is used for that makes it easy to decide. Even the color select can make sense to have dynamic as you maybe gonna change the value or something and then you're happy to just edit the value on the page and done. Otherwise you'd have to run a little script (easy too) to change already saved values in DB for pages.
  23. Not to mention you can also make it easily multi-language. One of the reason it's a clever system.
  24. Within a function use wire("user").
  25. You'll also find plenty of input on multilanguage in the multilanguage documentation: http://processwire.com/api/multi-language-support/multi-language-urls/
×
×
  • Create New...