Jump to content

bwakad

Members
  • Posts

    450
  • Joined

  • Last visited

Everything posted by bwakad

  1. Since pages are assigned to templates, how to move them to another tree - if you wanted to? I tried and received a permission error. Does that have to do with the template, tree-level or something else?
  2. I have mine set up as virtual hosts, actually two, if this matches my domain name then i presume it will be of no issue?
  3. Yeah, I thought about that. So, like I mentioned in my last post (before this one) I made it like this.... I have made my pages: root (skyscrapers) - provinces (parent) - - province (name of province) - - - municipal (name of municipal) In the templates for province and municipal, I just use the title fields now, but I am planning to include the map too. Then I renamed the following: root (skyscrapers) stays the same for now - cities > is now jobs - - city > is now company - - - item > is the same (I use it as function title) Eventually I will separate company - and link that to users... Item (the entry itself) is still using the skyscrapers template - where I just added the two fields province and municipal. Items are saved as: / Jobs / Company(name) / Title(function) And before saving it is required to select a value in both which are relational. This assures me also that items are separated in the tree from province and municipal. Working great. Maybe someone can benefit from this. I learn a lot from you guys, so I am happy with PW. The only thing I would like is to have a fixed width of the select box... have to look in that. The field 'municipal' was of course empty by default - producing just a little select button, maybe 5mm width - because no province was selected. Since the field municipal was related to province I could not use a normal default value to make this field become at least display something. The solution for this kinda field was pretty simple, in default value I just added "parent=page.province" (same as I mentioned in the post above).
  4. Well, I want to thank you all for the pointers - It does exist, but I was looking on wrong search terms in the forum and all. I have read a post from Ryan: Quote Actually, you can do this on the dev branch. Lets assume that cities are children of countries and that is reflected in your page structure (i.e. /countries/france/paris/). Create your 2 page fields (country and city), and configure 'country' as a single page field with "parent" set to "/countries/". Next, for the "city" field configuration, use the "Custom selector to find selectable pages", present on the "input" tab. In that field, enter "parent=page.country". Save and try it out. This works with select, selectMultiple and asmSelect fields (and possibly others), though not yet with checkboxes, radios or PageListSelect. - So, I have Skyscrapers - my pages are: provinces - province (drenthe) - - municipal (this) - - municipal (that) - - municipal (some) my templates are: provinces - province - - testing (added fields: province and municipal) my fields are: page field : province > single/null > required > parent selectable pages is Provinces page field : municipal > single/null > required > custom selector is parent=page.province Now it works thanks to you guys! If I select a province (which is required to choose) - I also get a select list for municipals in that province (and is also required to choose). And I do not have to use visibility because I need to choose a province and municipal. But I do wonder why a structure like this is not working? Provinces - a - b Municipal - a - b
  5. Using Skyscrapers by the way. Well, it's the first flaw I found in PW - not being able to make fields depend on eachother. Maybe I just need to have my pages like this: states > state-name > cities > city-name > items Maybe I just leave items out. They are not totally dependend on the city. I only have 12 states over here, and 403 cities. And states / cities would still be parent pages.
  6. But in general, this - and your interesting examples - would only give me two select which can be relational on a per page base, but not on its value. Like dynamic population of dropdown lists. But there must be a way to make one field point to another field.
  7. When talking about the page reference field - do you mean the page field type ?
  8. Well, I can not say much about frameworks, but someone mentioned PW is also a framework - and as such - I really starting to like it so much I don't think I will look at anything else (except naked woman bringing me a pint!)
  9. Actually, I was looking for something to have FIRST select prefill the SECOND select based on value of FIRST select - and then give me the fields and all. States and Cities for example.
  10. Hello, right now, in backend I have the following: 1: Cities-page (parent) > city-page (child) > item-page (child) 2: States-page (parent) > state-page (child) They are both select fields for an item to fill in - and still only in the back-end. But how would I go and make this relational? At first I thought to move the cities and all inside the state, but then I thought this would probably not make sence, because I would end up with a lot of selects. And all I really need is a first select (states) which in term fills the second select (cities) upon choosing a value in the first. So in short I place those fields on my template, but how to connect them?
  11. On the other side of your pond, we have troubles with callers from italy - claiming they have an offer thats very interesting. How-ever, some people reported - If you wait more then 5 minutes - they take over your phone line and the next month you end up with a big bill ! But I must admit, these people sometimes have luck making someone believe this is real. We might think they are stupid, but they will collect sooner or later on type of scams you mentioned. Just in case: you better reformat your harddisk. lol
  12. I am playing with the selector from skyscrapers - in the following code from the file: includes/functions.php function makePrettySelector($selector) { if(preg_match('/(architects|parent)=(\d+)/', $selector, $matches)) { if($page = wire('pages')->get($matches[2])) $selector = str_replace($matches[0], "$matches[1]={$page->path}", $selector); if($matches[1] == 'parent') $selector = str_replace("template=skyscraper, ", "", $selector); // template not necessary here } return $selector; } the selector returns output, explaining what was selected (to search). But what if I wanted to output anything what could be searched or selected? This code puzzles me : if(preg_match('/(architects|specialties|materials|parent)=(\d+)/', $selector, $matches)) { Is there no wildcard to use for this?
  13. Here I go again... I hope none of you get bored, but I installed Page List Show Page Id module. The reason for this is I want to change a couple of pages and would like to hold on to the order of ID as much of possible. That way it will be as less as possible spread over the database. But I see Pages are shown as ASC by default, and since I wanted to know their ID as well I installed the module, hoping it would give a filter. But, although it is a functional module, it does not filter. Does anyone know of a way to filter, or make this module display by ID as well. Now, before people point me in the Batcher module direction, it currently has one flaw to work with - it does not refresh after a change if you edit, this has probably nothing to do with the module, I might need to look for ajax or something, don't really know. I am just thinking out loud here. edit -------------- Finally - I knew I had seen it somewhere - Setup > Templates > Parent-template - under Family Tab I can arrange sort for it's children's pages. I did not see ID, but thinking logically, the native field "created" is the one I need!
  14. You guys are quick and amazing. Just one question for search-form.php, should this: $selected = $architect->name == $input->whitelist->city ? " selected='selected' " : ''; not be whitelist->architect Changed that. Your code works. Great help here! Now I need to figure out a way to use the form as a filter - starting from the current page, I believe I already have seen it somewhere in the "Joss tutorial".
  15. That's funny I think I came along your unbuild skyscraper: https://processwire.com/talk/topic/5925-trying-to-expand-search-form/#entry57888 but in other words: considering architects (parent) > architect (child) $content = renderSkyscraperList(findSkyscrapers("architects=$page")); current page is architect (child) will give me items by architect (child). considering cities (parent) > city (child) > item-name (child) $content = renderSkyscraperList(findSkyscrapers("parent=$page")); current page is city (child) will give me the item-name (child) that has the parent city (child). I had to go through explanations several times. lol
  16. But then how come it works for the cities? The code is the same, except the name in the code is different, e.g.architect versus cities, architect versus city. In the back-end both city-pages and architect-pages have a parent-page. Or does it has something to do ith this code. the first is from architect.php - second is from city.php $content = renderSkyscraperList(findSkyscrapers("architects=$page")); $content = renderSkyscraperList(findSkyscrapers("parent=$page"));
  17. Okay, I understand. Thanks for the clear explenation. I will try to report it - just for clear context.
  18. No ,I do not think so since the select works on a single architect to fetch skyscrapers from that architect.
  19. Using the Skyscrapers, I wanted to see if i could add architect to the search form as a select field to search, like city is. So I just went along and copied the code from city.... and although it displays in the searchform, it does not show results... what do I miss? In includes/search-form.php I added this code: <!-- added architect --> <p> <label for='search_architect'>Architect</label> <select id='search_architect' name='architect'> <option value=''>Any</option><?php // generate the architect options, checking the whitelist to see if any are already selected foreach($pages->get("/architects/")->children() as $architect) { $selected = $architect->name == $input->whitelist->architect ? " selected='selected' " : ''; echo "<option$selected value='{$architect->name}'>{$architect->title}</option>"; } ?> </select> </p> In search.php I added this code (before the code for city select): $summary = array( // added architect "architect" => "", "city" => "", "hours" => "", "floors" => "", "year" => "", "keywords" => "", ); // added architect // if a architect is specified, then we limit the results to having that architect as their parent if($input->get->architect) { $architect = $pages->get("/architects/" . $sanitizer->pageName($input->get->architect)); if($architect->id) { $selector .= "parent=$architect, "; $summary["architect"] = $architect->title; $input->whitelist('architect', $architect->name); } }
  20. I noticed in the files architect.php and city.php these minor difference in code: $content = renderSkyscraperList(findSkyscrapers("architects=$page")); $content = renderSkyscraperList(findSkyscrapers("parent=$page")); But if I a not mistaking, they are basically telling the same thing, one explicitly and the other dynamically. Hope I am right?
  21. I see your point. Ok, i will try that module first. Thanks for thinking with me.
  22. Okay, since I use Skyscraper as a base to start. I need to rename the present Architect-name to Company-name. So Architect: A Eugine Kohn becomes Company: McDonald. And so on... Right now, I am only concerned about the title, but opening the page and under settings-tab the part of the url need to be set to. I can of course do it one-by-one, but I thought there might be an easier way.
  23. Well, not to be rude or anything, but now you are implying people need to know that the phrase "JqueryDataTables" is a module? I guess I just have to learn all existing modules by memory and hope no-one creates a new one - I might flunk the test. lol This phrase is put in the module part upon installing. And when I was in the Modules/plugins section of this site at ModuleManager it did had a button saying "support board"??? But never mind, maybe the link over there is simply redirecting to the wrong topic....
  24. Hi Joss, That's a good tutorial - did not think these modules and about updating JQuery. Concerning the JQuery, since it is now - either 2.1.0 or 1.11.0, some of us have this code in a file somewhere: <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/jquery-1.4.2.min.js"></script> I understand the tutorial it is meant for starters that should at least know a little about these things, so perhaps you add it, or leave it. It's your tutorial. One time on a website I noticed code to automatically include this JQuery script whatever the name of it was, but I can't recall how the code was. Was nice to learn the difference between $page versus $pages, and especially the statement ("headline|title"). Really nice job!
  25. Hi, I just unzipped and placed the module in the modules folder on localhost. To install this module the 'install' button is dimmed, does not seem to work. If I click the module-name itself then in a window it ask me if I want to install this module. But also nothing happens. Any suggestions? I use PW2.4 and am on localhost. EDIT>>>> I had to download and install Jquery Data Tables module first. In my opinion: when I see a text "requires..." I do not assume that I do not have it and WHAT it is. How is one to know what it is - a file or something - and if it is not installed in the core already? It would however be nice if this text - when not installed yet - could be: please download and install Jquery Data Tables module first! Any way it's working now. Thanks
×
×
  • Create New...