Jump to content

Nico Knoll

PW-Moderators
  • Posts

    1,835
  • Joined

  • Last visited

  • Days Won

    21

Posts posted by Nico Knoll

  1. If your hoster allows it you can even use something like:

    <?php
    // fetch the json displayed on the service page
    $dataJson = file_get_contents('http://url.com/service-page/');
    
    // transform it into a php array
    $data = json_decode(dataJson, true);
    ?>
    

    If this shouldn't work you can use file_get_contents_curl (not default PHP function but you can find it here: http://stackoverflow.com/a/8543512/4044167) instead of file_get_contents()

    • Like 2
  2. Yes processwire supports this. But it's not really a sub-template. It's just a child-page using another template and a shared navigation which is as easy as:

    <?php
    $mainPage = $pages->get('/bio/');
    
    $navPages = $mainPage->children()->append(mainPage);
    
    foreach($navPages as $navPage) {
    echo '<a class="tab" href="'.$navPage->url.'">'.$navPage->title.'</a>';
    }
    
    ?>
    
    

    Structure could be like this:

    bio (using "bio" template(url for this child page would be /bio/))
      - location (using "location" template (url for this child page would be /bio/location/))
      - some other page (using another template (url for this child page would be /bio/some-other-page/))
    
  3. Look at the description of how to use "Allow new pages to be created from field?":

    1. Both a parent and template must be selected above.
    2. The editing user must have access to create/publish these pages.
    3. The label-field must be set to "title (default)".

    Have you specified a template new tags should use?

    post-140-0-45718100-1429215740_thumb.png

    • Like 1
  4. @Lostkobrakai: Added all of your suggestions :)

    @marcus: Of course! Let me know if I need to change something or if you want the source code :)

    @Craig A Rodway: Fixed it.

    @kongondo: It's written in PHP and doesn't use PW as backend. So I wasn't sure where to post. But probably module section would be the way to go. I moved it there now. And I removed the closing thing.

    @blad: Thanks!

    • Like 5
  5. Hey,

    as I often just copy someone else's (sometimes my own) modules structure as a starting point for a new module I thought there has to be a better way to archive that. That's why I created the "ProcessWire Module Generator":

    modules.pw

    If something missing? Or some more wishes for options or best practices? Let me know :)

    Here's a screenshot:

    screenshot.gif

    • Like 32
  6. @Macura: Try to upload it directly into /wire/.../CKEditor (like here: http://monosnap.com/image/dETfuhFapWn79p36bIwmAsR6ANGNHc) and use the config.js to change it. Should look like this afterwards: 

    /**
     * @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
     * For licensing, see LICENSE.md or http://ckeditor.com/license
     */
    
    CKEDITOR.editorConfig = function( config ) {
    	// Define changes to default configuration here. For example:
    	// config.language = 'fr';
    	// config.uiColor = '#AADC6E';
    	 config.skin = 'lightwire';
    };
    

    And change the config.js in site/modules, too.

    • Like 1
  7. What I want to archive is that you have like ten constant suggestions but still can add your own tags which should be saved but not appear in the drop down list. Maybe I have to change it a little than :/

    Or is there another way to archive that?

  8. Is it possible to allow users to add pages by typing in something but still only show the same pages as before in the drop down?

    For example I have "foo" and "bar" as pages which get shown in the dropdown. Now user1 types "lorem". So a page called "lorem" get created.

    Now user1 creates a new page. The drop down should only show "foo" and "bar" and NOT "lorem".

    Maybe if "lorem" would be "hidden" the drop down could exclude it... Could you add this as an option? Like: "make auto-created pages hidden to prevent them from appearing in the list"?

×
×
  • Create New...