Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by louisstephens

  1. Yet another great example of the power of processwire! I was curious, since you have one template file, how do you handle all the "blocks", though conditional statements? I really like this approach and actually was working on something similar, but tbh, I kinda got lost in all of my conditional logic.
  2. 1. I would assume that the Robots field is where you could insert "noIndex or noFollow". This tells web crawlers to basically ignore the page from crawling. 3. The canonical link tag ie : <link rel="canonical" href="path_to_page" /> tells search engines where the original version of the content is located. This comes in handy when you are utilizing AMP, so google can differentiate the desktop version (canonical) and the accelerated mobile page. As for number 2, it looks like you can input schema tags . However, do you know if these fields were created from scratch, or are these generated by a certain module like SEOmaestro?
  3. Hey Mafuz, did you mean to post your question regarding django in a forum for ProcessWire? Stackoverflow might be the best forum for you to get your question answered.
  4. I have used ProcessWire as more of a framework numerous times last year. I will say, that sometimes recreating some of the backend functionality in the frontend was a bit of the headache (solely based on things like repeaters etc). Overall, it was very easy to get a front end going and using ajax to post/pull from the backend. I did use the Pages2Json to deliver the json with made the requests a bit easier for me. I am sure there are many more people here that have made bigger scale web apps though, and they might be able to give a bit more in depth response.
  5. I have not implemented this yet for myself, but I did stumble across this in my bookmarks. It looks promising with srcset etc.
  6. Well darn, I set $config->advanced to true, and nothing seems to be changing for me on the field settings. Is there something else I need to change out? That was completely my fault. I changed a config in the wrong folder without thinking. Thanks adrian, that solved the issue.
  7. Thanks adrian! I went to the advanced tab, but perhaps I am missing something. The only options present are: tags icon autojoin global I then went through tracy to delete it, but I am still met with the samed flagPermanent error message. I will continue to poke around and see what might be causing it.
  8. Hey iipa, Just curious, how are you calling the file in your template? I have used the following without issue in the past. <link rel="icon" type="image/png" href="<?php echo $config->urls->templates?>/favicon.png" />
  9. Hopefully this is the right place, if not, please move it to the proper sub. I installed the multi language module on my development (sandbox) set up not too long ago to test out a few things. From the start, I ran into some issues with dependencies not being met/installed, so I thought that I would simply just uninstall what had been. Unfortunately, that took me down a road of using some code in my home template to remove the modules (cant find it at the moment). After some struggling, I finally got it uninstalled, but it left behind 3 fields, language language_files language_files_site I thought that I could simply remove them from the languages template and then delete them, but I get the following error: I was wondering, is there a way to remove these using the api? I couldn't add any new users to the setup until I made "language" not required, but I was hoping to just remove all of the fields.
  10. I have used colorlib in the past. However, I don't really use pre-made templates all that much. I do find that writing the code from scratch really is beneficial to my workflow as I know exactly where everything is/functions. Are you looking for basic layouts, css dependent layouts (bootstrap, css grid, etc etc), or are you looking for processwire specific templates? On that last point, to my knowledge there are not too many out there/if any that are plug-n-play.
  11. From what I read, it actually returns the nth item from the array. Returns the single item at the given zero-based index, or NULL if it doesn't exist. Couldn't you just do: $count = -1; foreach($page->images as $photo) { echo "<li uk-slideshow-item='{$count}'><a href='#'><img src='{$photo->size(150,100)->url}' alt=''></a></li>"; $count++; } ======= Dragan beat me too it.
  12. I actually did exactly as wbmnfktr suggested in a previous project (still in development). At first I was a bit hesitant of having to create new ingredients every time I wanted to add a new unique recipe, but the pros quickly outweighed the cons. It makes filtering on the front end a lot better/easier, as well as makes new recipes easier.
  13. So I was tinkering around with the "select fields" field type and added it to a repeater. My thoughts were I could have a user select a field (textarea, text, etc etc) that I defined and give it a name (another field in the repeater) and create their own form on the page. To be honest, I am now a little lost with rendering the form and mailing the results as potentially the form will be unique and custom every time. The only way I know to handle the output is by going about it this way: $forms = $page->form_select_fields; foreach($forms as $form) { if($form->name === "form_input") { //output input with custom name } elseif($form->name === "form_textarea") { //output input with custom name } } Is there a better way to go about rendering the elements from the repeater? As far as the custom sending goes, I am really at a loss since it would be pretty dynamic. Has anyone used this type of approach, and if so, how did you handle this without going insane?
  14. I haven't had this issue yet with file attachments. However, I have had several timeouts with a very simple form (4 inputs) that create new pages using the wiresmpt module.
  15. I have noticed this for awhile now. I guess I just always assumed that it "opens" the page tree for what you clicked on: - Parent Page (id:1) -- Sub Page (id:2 - has 4 children) -- Sub Page (id:3) --- Sub Sub Page (id: 5 - currently open) -- Sub Page (id:4) If you were on the "Sub Sub" page of id 3 and clicked on the Sub page with id of 2, it would "open up the tree on id 2 and collapse the rest of the tree. Well, that has been how it has been for me.
  16. Have you looked into Admin Restrict Branch: https://modules.processwire.com/modules/admin-restrict-branch/ ? This should allow you to achieve the first part of your post.
  17. Thanks @bernhard! That was exactly what I was looking for. Now I'll continue down the path of learning hooks, and hopefully stop making mistakes like: $p = new Page(); $u->template = "scripts"; $u->parent = wire('pages')->get($page->id); $u->title = "Test"; $u->name = "test"; $u->save(); Which obviously just blows up in your face.πŸ˜…
  18. So I have been diving into hooks lately, and I am enjoying them thus far. However, I guess I am a bit stumped on how to achieve what I want too. I am trying to set up a hook that would create a new child page when the parent page is saved. However, when you save the parent page a second time, I just need to update the child page without creating multiple child pages. What would be the best way to go about this? So after rereading my post, I believe it is a bit vague so I will try to explain more. The Goal: Create a page with a template "one". Once the page is created/saved => create a new child page with the template of "two" If the parent is saved anytime after, do nothing to the child page (limit the parent page to one child page) The parent page is really just being used to output content, whereas the child page is being used to pull out the some fields from the parent to be used elsewhere. I might have made this too complicated in my head.
  19. If you look in that specific file, do you see the following: /** * ProcessWire namespace aware version of PHP's class_parents() function * * Returns associative array where array keys are full namespaced class name, and * values are the non-namespaced classname. * * @param string|object $className * @param bool $autoload * @return array * */ function wireClassParents($className, $autoload = true) { if(is_object($className)) { $parents = class_parents($className, $autoload); } else { $className = wireClassName($className, true); if(!class_exists($className, false)) { $_className = wireClassName($className, false); if(class_exists("\\$_className")) $className = $_className; } $parents = class_parents(ltrim($className, "\\"), $autoload); } $a = array(); if(is_array($parents)) foreach($parents as $k => $v) { $v = wireClassName($k, false); $a[$k] = $v; // values have no namespace } return $a; }
  20. As far as I can tell, it might not be possible yet. There seems be some "work arounds" that can be found here: https://stackoverflow.com/questions/30121969/making-a-private-githubs-wiki-public https://help.github.com/articles/changing-access-permissions-for-wikis/ (though I am not sure what can truly be done here, as I dont have github pro account. With the "free" private repo, you lose access to wikis)
  21. Yeah, I just learned about it this past Monday, and I was pretty excited. I believe the only "catch" is that you can only have 3 contributors on the repository.
  22. From my last post, I was given a good idea on how to count the repeater items, and it worked wonderfully. I got my code working well and the columns (based on the count) all work well as well. Now, I have a head scratcher on my hands. <?php $buttonsIncluded = $page->special_custom_buttons->find('special_custom_buttons_include=1'); $buttonsIncludedCount = count($buttonsIncluded); $buttonsIncludedCountAdditional = $buttonsIncludedCount +1; echo $buttonsIncludedCount; ?> <div class="row"> <?php foreach($buttonsIncluded as $button): ?> <?php if($button->custom_buttons_include): ?> <?php if($buttonsIncludedCountAdditional == 2): ?> <div class="col-6"> <a href=""><?php echo $button->custom_buttons_text; ?></a> </div> <?php elseif($buttonsIncludedCountAdditional == 3): ?> <div class="col-4"> <a href=""><?php echo $button->custom_buttons_text; ?></a> </div> <?php elseif($buttonsIncludedCountAdditional == 4): ?> <div class="col-3"> <a href=""><?php echo $button->custom_buttons_text; ?></a> </div> <?php endif; ?> <?php endif; ?> <?php endforeach; ?> </div> All of this is included in a larger foreach statement that is pulling in other data (like body copy etc etc) from a Page Table field. As you can see in my code above, I am adding "1" to the count, so I can have space in the grid layout for a new button. So, right now: it looks something like: [repeater button] [repeater button] [repeater button] [space for new button] What I really need to do is to pull in the button from the Page Table and add it into the new space so it looks like: [repeater button] [repeater button] [repeater button] [button from Page Table] Is this even possible todo, or is there a better way to go about this? *Edit* So, I really just overlooked something quite easy here. Since the grid is based on 12 columns, I could just take 12 and divide by $buttonsIncludedCountAdditional which would give me the remaining col width to use outside the foreach loop. I was trying to make this too complicated.
  23. Is it possible to use count() to return a number of repeater items don't have a checkbox checked? In my current set up, I have a repeater on the page "dev_repeater" with a checkbox called "dev_repeater_exclude". I need to get a count of the current items that do not have it checked so I can pass it to my css grid to alter the column width.
  • Create New...