Jump to content

Adam Kiss

Moderators
  • Posts

    1,303
  • Joined

  • Days Won

    7

Everything posted by Adam Kiss

  1. Yeah, we want with the responsive option, even though there were parts, that are maybe little complicated, like responsive content slider... Maybe even over-engineered a little.
  2. I am working on one currently, ETA 3 weeks
  3. As I understand it, PUT and DELETE are there to define what actions should be done with resource, acting as parameter on a different level (http request level). It's a way to standardize things, I believe.
  4. Actually, this could be possible right now as well - symlinking your db files into repo on one end, and symlinking your repo into your mysql dir on the other... it should work
  5. What is wrong with strip_tags? $strippedText = strip_tags($unstrippedText); Regarding length, you could use one of the word / sentence cutting functions. I have no time to search for one right now, but I remember seeing one, that would take string and length you wanted - and it gave you snippet, which ended with full sentence (if the delta between max_length(the one you wanted) and actual length was lower than 5%) or with whole words.
  6. It's because OS X (and other *nix systems too, I think) require root password (or root access) for anything that's accessing (or broadcasting) through ports lower than 1024.
  7. Sorry, I was checking against docs, and the only function that had Page as parameter was that one, so I got confused here.
  8. Hey neil (are you neil?), I'd say go check out the source of configurable modules. The code for building the configuration options is there - you'd only save the fields into db: // this is a container for fields, basically like a fieldset $fields = new InputfieldWrapper(); // since this is a static function, we can't use $this->modules, so get them from the global wire() function $modules = wire('modules'); // Populate $data with the default config, because if they've never configured this module before, // the $data provided to this function will be empty. Or, if you add new config items in a new version, // $data won't have it until they configure it. Best bet is to merge defaults with custom, where // custom overwrites the defaults (array_merge). $data = array_merge(self::getDefaultData(), $data); // showModal field $field = $modules->get("InputfieldCheckbox"); $field->name = "showModal"; $field->label = "Use modal window"; $field->description = "Whether open pages in modal (overlay) window or goes to traditional administration."; $field->value = 1; // providing a "checked" value for the checkbox is necessary $field->attr('checked', empty($data['showModal']) ? '' : 'checked'); $fields->add($field); return $fields; This is from latest AdminBar by @apeisa. You can see the '$field' part, where the field is built. You probably only run $field->save() at the end instead of current $fields->add() and you have just created field via code Adding fields to the template will be probably close to the ->add() call, and I'm totally not sure about reordering them in the templates via code, you might need to play with this a little.
  9. Hey netcarver, regarding versioning presentation elements - since ProcessWire deals with raw data and makes no assumption what you'll do with them code-wise, this part is totally up to you - if you wish, you can store HTML in the database (as I did on multiple occasions, where it made sense to store data with basic HTML around it), or you can store 'pure' text, checkboxes, textareas in db and have full code in your template files - so this is totally up to you. And regarding database, I'll leave this to someone more knowledgable.
  10. I am not totally sure here, but you might be right Raphau, you may need to test slkwrm's suggestion
  11. Hi and welcome to the forums Raphau, I don't know what complexity has your website, but one of the solutions is to check for substrings: assume two pages: /xyz/page1 - /xyz/page1/page2 As you can see, parent's url is aways present in childs URL (if only because in processwire we have single-ish page tree). So the condition can be made like this: if ($page->url === $child->url || $page->parents->has($child)) This checks whether page url is the same as the $child url and if not, checks whether $child is in the parents of the active page Edit: instead of isValidItem, it should be 'has()'. I fixed it Ultimately, if your navigation has only two levels, you can go with something simpler: if ($page->url === $child->url || $page->parent->url === $child->url) This will check current url against $child, and its parent's url against $child. Notes: I changed your code to check against URL (in format '/xyz/abc/page-name') I went for typed comparsion (=== vs. ==)
  12. It also doesn't support tabs, AFAIK - that's why I mentioned neon (if you like YAML, neon seems the way to go):
  13. I would totally go with YAML Parsing here There is also a neon, which looks like some sort of 'YAML' with few fixes. Are you interested in YAML? I'm thinking about creating a module, which would some more advanced configuration (I'll talk about it more later, when at least readme would be done:) ), So I'm thinking we could do module named e.g. 'CodeYAML', which would add support for YAML parsing (so you would not have to parse it manually in code or distribute it, you'd have only one dependency). What do you think?
  14. Then it actually totally doesn't have to be header... just make it a.header and you're all set. It seems to me that you do not know this (pardon me if you do), but with 'display:block;', link ('a') will act as if it was just another div, so I would go for it - it will work the very same way it does now without any javascript. Note: If it will seem I push it too hard, it's only because I always try to go for as little JS as possible, and this is one of those rare moments when using pure HTML instead of JS is dead simple.
  15. Hello and welcome to forums What a great way to present yourself - with a pull request. Nice.
  16. Not only that, but if you have php code in your javascript files, server has to know to run it through PHP before serving to browser
  17. Hey tinacious, are you using virtual hosts for instance? you have to change that. Also, if you forget, any hardcoded reference (or php code based on non-hardcoded base URL) has to be changed. Not to point out the obvious, but we also (often? ) overlook the basics.
  18. nikola, the problem is probably here: $selector .= "price>=$priceMin, $price<=$priceMax, "; should probably be: $selector .= "price>=$priceMin, price<=$priceMax, "; (notice the dollar sign in the second condition)
  19. The simplest way is to create PHP enhanced javascript; Rename the file from .js to .js.php, and change it like this: /*Make header div clickable*/ $(document).ready(function() { $('#header').click(function(){ window.location = '<?php echo $config->urls->root; ?>'; }); $('#search_form').click(function(event){ event.stopPropagation(); }); }); /*End header div*/ And include src="myscript.js.php"; Alternatively, you should be able to do this like this: //...snip window.location = '/'; //...snip Alternatively, you could (and I would totally do this) switch your HTML, so everything that should go to index will be normal link - a <header><a href="<?php echo $config->urls->root; ?>"> <!-- your data here --> </a></header>
  20. I'm not sure... what is the number of the posts?
×
×
  • Create New...