Jump to content

neosin

Members
  • Posts

    107
  • Joined

  • Last visited

Posts posted by neosin

  1. @Robin S thank you but I can't get this to work, not seeing any error messages or anything. I created the admin.php in "/site/templates/" and pasted the code and made the necessary changes but nothing happens/changes after logging in-out and trying multiple roles. I am assuming this code will change "Pages" in the top admin nav menu to "Streams" and give it the right url but it's not changing anything in the admin nav.

     

    On a side note, how does everyone else manage hundreds of thousands of pages in a tree list?

    Curious to know if there is a way in admin to paginate the page list or certain pages in the page list somehow because I have 300000+ child pages under one page. It would be nice to paginate by 50 or 100 records at a time.

  2. 6 minutes ago, louisstephens said:

    I have found that this article really helped me out on a recent project. It guides you through creating a new module that adds the Name/link to the nav bar at the top.

    Right but it requires the page to live under "admin" page which is not the result we want. There is also an existing module https://modules.processwire.com/modules/process-admin-custom-pages/ to do this so you don't even have to create a module for this however it uses "admin" page as the parent.

  3. While there is an existing module to add links to the admin menu, that module uses pages under "admin" page and custom template process files.

    What about content that lives under "home" and works like regular cms pages?

    Can you add option in page "settings" of pages, which would allow that page to have a nav link in the admin menu?

    Let's say we have a page called "Streams" that cms users can add/edit children and visitors can view on the front end.

    Streams live under "home > streams".

    Use case

    1. We want to add "streams"  to the admin menu because it is a primary content container.
    2. We want cms users to be able to add and update "streams" but they must not see the admin page tree because it is full of things they don't need to see, ever.
    3. We want the admin "streams" menu item to be "active" when a user is viewing the stream list, creating/viewing/editing a "stream" instead of "pages" being active in the top admin nav menu.

    Currently to do this we hide the page tree from non-superadmins using the hide page tree module and then we also edit the UIKit admin theme to return null for breadcrumbs because we don't want users to see anything to do with the page tree. And lastly we use the admin page module to create the streams page under admin > streams and create a custom process file which basically duplicates all existing page code in core just to get the same functionality of the pages under "home > streams" which seems completely unnecessary. There has to be a better way.

    So ideally, there would be :

    1.  A settings option in all pages to add a selected page to the admin menu regardless if it lives in "home" or "admin".
    2. A settings option in all pages to say "use this as default active item" when selected in admin nav menu.
    3. A built in default option to hide the pages tree from non-super admins
    4. A built in default option to hide the breadcrumb "tree" link from non-super admins

     

  4. My dashboard child pages are not showing in breadcrumbs, how can I get them to display ?

    for example, I added a page in admin under dashboard and when I navigate to it in the cms I can see it fine but the breadcrumb still shows "home > dashboard" instead of "home > dashboard > My Page".

  5. @MilenKo    For interfaces (buttons, short strings, etc)  this is what we do,  I am not saying either way is better just different way of doing this.

    ## _languages.php
    
    $lang_strings = array(
    	'home_button' => array(
    		'en'=>'Home',
    		'fr'=>'Acceuil',
    	),
    	'about_button' => array(
    		'en'=>'About',
    		'fr'=>'Apropos',
    	),
    	'links_button' => array(
    		'en'=>'Links',
    		'fr'=>'Liens',
    	),
    );
    
    ## _func.php
    
    function userLang($lang){
    	switch($lang){
    		case 'fr':
    			$lang = 'fr';
    			break;
    		default:
    			$lang = 'en';
    	}
    	return $lang;
    }
    
    ## _main.php
    
    $lang = userLang($user->language->name);
    
    <nav>
    	<div><a href="#"><?= $lang_strings['home_button'][$lang]; ?></a></div>
    	<div><a href="#"><?= $lang_strings['about_button'][$lang]; ?></a></div>
    	<div><a href="#"><?= $lang_strings['links_button'][$lang]; ?></a></div>
    </nav>

     

    • Like 1
    • Thanks 1
  6. In the PW website modules section, currently it is up to module authors to mention if their module is supported by whatever version of PW.

    Use the power of the community to solve the busy dev dilemma!

    It would be great if users could have some way to indicate a particular version works for them or not. Perhaps a simple "This module (works/or not) with current version (insert version here) of PW" and then in the module listing it shows a table of versions user have confirmed it works with.

    PW version | Module version | Works / Not Works

    2.0.71 | 0.0.1 | 100 users said this works

    3.0.95 | 0.0.1 | 100 users said this does not work

    3.0.95 | 0.0.3 | 20 users said this works / 1 user said this does not work

    3.0.96 | 0.0.3 | 31 users said this works

    Bonus of implementing this would be that it also helps lessen the forums threads "dos this module X work in PW version X?"

    I wonder if the poll module could be used for this?

  7. @ryan

    it would be great if there was an option to save the map (using static maps api?) to an image file locally and that local image would update should the map field values change. This would mean not needing to use an API key since the traffic would be to your hosted image and not making requests to google maps api each visit. So to the cms user they are seeing gmaps as usual but the cms saves a static version of their work to an image that is used on the output side.

    Also it would be neat to have a checkbox that enabled to  use JS/CSS to provide artificial zoom/map moving function using the static map image assuming it was at a decent resolution/dimensions and perhaps marker placement as well. Otherwise if the checkbox is un-selected, it will show a map image of defined dimensions with no zoom or bells & whistles, etc.

  8. On 1/19/2016 at 11:10 PM, Macrura said:

    the latest screenshot i use pages for the shortcut widgets as follows; this is a basic setup and will be expanded upon gradually:

    the widgets are pages

    post-136-0-66928000-1453262816_thumb.png

    this is the template for making shortcuts; the shortcuts are configured first, and then added to the widget;

    this way shortcuts can be used in any widget

    post-136-0-37215300-1453262818_thumb.png

    this is the page for configuring a shortcut widget

    post-136-0-19009700-1453262819_thumb.png

    this is the shortcut page showing the page select for the shortcuts

    post-136-0-55615400-1453262817_thumb.png

    there is one template file dashboard.php which controls the contents of the dashboard.

    the shortcut widgets are generated automatically based on being setup in the admin;

    the lister widgets are currently hardcoded but the plan is to make them configurable using a selector field

    @Macrura I am very interested in this, is it available as a package or module for download?

  9. On 11/18/2017 at 12:53 PM, dragan said:

    Thanks for this module! I had to change a few things to get this to work with PW 3.0.84

    a) add PW namespace

    b) change page id from 2 to 3 (2 = admin root, but 3 = page, which is the actual default landing page after login)

    
    if ($this->page->id === 3) {
    

    (and then the two lines from @Macrura above)

    c) 

    
    //        $t = new TemplateFile($this->config->paths->siteModules . __CLASS__ . "/dashboard.php"); // this creates a URL like site/modules\ProcessWire/ProcessDashboard/
            $t = new TemplateFile($this->config->paths->siteModules . "ProcessDashboard/dashboard.php");

    Perhaps you could re-check, and publish a new version that officially supports PW 3 ?

    @dragan  thanks for this, it solved my issues with the module

  10. 1 minute ago, Beluga said:

    When I said "you naturally can't use "grid in grid" for navigation layout etc.." I was referring to the simple fallback solution of all unsupported browsers falling back to mobile layout. I was not referring to what CSS Grid can or cannot support.

    ah gotcha, thanks for the clarification. I think the simple fallback solution is awesome.

    here's a list of the latest supported browsers for anyone interested https://caniuse.com/#feat=css-grid

     

    • Like 1
  11. On 10/19/2017 at 5:32 AM, Beluga said:

     

    One caveat is that you naturally can't use "grid in grid" for navigation layout etc..

     

    you can use grid in grid. since there is no support for sub-grids at the moment, the only way to do a layout is grid within grid.

    you just have a re-declare the grids that go inside the other grids.

    here's a quote from the smashing mag grid article

    Quote

    However, a grid container (one whose element is set to display: grid) only treats the elements that are direct descendants as grid items. This means you can’t create a single layout grid here. Instead, you have to create grids at the component level, effectively creating multiple grids with the same properties.  (https://www.smashingmagazine.com/2017/06/building-production-ready-css-grid-layout/)

    What this is saying is that you cannot have a single grid system to deal with the layout but rather you need grids within grids. This creates extra code but still not as much as say something like flexbox and all it's css&divs.  Also there is not reason why you can't use css-grid and bootstrap together. SImply ignore the flexbox components.

    Here is a sample Bootstrap responsive layout using CSS grid . Not a whole lot of code. (make sure to click the html/css tabs to see the src)

    also, here's a neat project

    Bootstrap’s grid in CSS Grid

    https://mdo.github.io/bootstrap-css-grid-layout/

     

    • Like 2
  12. 8 hours ago, Mike Rockett said:

     If you don't mind my asking, why do you need published pages that redirect to others?

    @Mike Rockett

    i have an events content type and the event pages expire and unpublish after the date has passed however events that are flagged as special can remain active (the url) because it will have been promoted across various media outlets. These expired special event urls will redirect to a related published content item. The related content items do not exist before or during the events. The related items are added by an editor shortly after the event has finished.  Then 6 months later an editor comes back and unpublishes whichever special events they need to remove.

    perhaps with PW there is a better approach? I am new to PW please go easy on me ;)

     

  13. 9 minutes ago, adrian said:

    Hi @neosin - thanks for reporting - looks like it was a multi-language site bug that crept in at some point.

    Can you please try the latest version and let me know if everything looks ok now?

    Thanks!

    updated and I can confirm the issue is resolved thanks.

    On a side note, I keep getting mixed up with the save buttons all over the place in the modal and the pages. Clicking save twice will take some getting used to.

     

    • Like 1
  14. I found a definite bug (latest module+pw 3.0.96)

    If you go to a page and click children, choose batch edit, choose "edit" mode (only one i tested) as the option and then in the list; edit some children in the modal and save those - the children titles in the parent will have no value set for "title" and in the batch list it now shows empty values where the titles used to be.

    It appears that the variable for title is not saving or updating properly. I was editing other fields but for some reason it made my titles blank when I didn't edit the titles... very odd.

    Screenshot-2018-3-21 Edit Page Streams • 127 0 0 1.png

    also the title in the actual children themselves is now empty (in English, French is fine)

    • Like 1
  15. 17 minutes ago, bernhard said:

    @bernhard   thanks, this should work I guess

    while($row = $result->fetch_assoc()) {
      $title_en = wire("sanitizer")->text($row['title_en'], array("maxLength"=>128));
      $title_fr = wire("sanitizer")->text($row['title_fr'], array("maxLength"=>128));
      $p = wire('pages')->get("title={$title_en}");                                 
      if(0 < $p->id) continue;                                                   
      $p = new Page();
      $p->title->setLanguageValue($languages->get('en'), $title_en);
      $p->title->setLanguageValue($languages->get('fr'), $title_fr);                                                       
      $p->save();
    }

     

  16. On 9/2/2015 at 3:31 PM, horst said:

    There is one thing that needs a bit attention when importing data. We need to check if a record was also imported by a previous run of the script, otherwise you may end up with numerous duplicates.

    
    while($row = $result->fetch_assoc()) {
      $title = wire("sanitizer")->text($row['title'], array("maxLength"=>128));  // fetch and sanitize the title
      $p = wire('pages')->get("title={$title}");                                 // check if it already exists
      if(0 < $p->id) continue;                                                   // move on to the next record if it exists
      $p = new Page();
      $p->template = "dam";
      $p->parent = "something";
      $p->title = $title;                                                        // use the sanitized title
      $p->save();
    }

    how would I do this for multilingual data?

    if in the external DB in each row we have some fields for both languages

    example:

    $row['title_en'] $row['title_fr']

    $row['summary_en'] $row['summary_fr']

    $row['other_en'] $row['other_fr']

     

     

  17. I have latest PW+Tracy installed and when I go to edit a page in the admin I randomly get these notifications

    Quote

     404 occurred: /wire/modules/Inputfield/InputfieldFile/InputfieldFile.css.map
     404 occurred: /wire/modules/LanguageSupport/LanguageTabs.css.map

    I looked in those folders and there are no map files, not sure why PW is trying to find them or why they would be missing.

    This seems occur when I use the "inspector" in the browser to look at elements.

  18. 2 hours ago, Macrura said:

    @neosin pls use jumplinks

    or see @kixe‘s fork above

    ty

    Does this module allow you to redirect content from one post to another?

    I have pages that must remain published but redirect users to other pages, I am not sure what the best approach is for this with PW or if there is a module already that can accomplish this.

  19. 45 minutes ago, Robin S said:

    There is a feature for this built into image fields (Details tab):

    2018-03-20_101047.png.073dd302842ba47d1c083781c45671c5.png

    yes I am aware of this however in my template code I could not find the way to get the image path from the default page field.

    From another thread I found the path is $page->field_name->httpUrl which works as expected since it inherits the fields.

    What I was missing is the httpURL parameter

    thank you

     

     

×
×
  • Create New...