Speed
Members-
Posts
65 -
Joined
-
Last visited
Everything posted by Speed
-
Oh *facepalm*, I completely forgot about this! Thanks Adrian for reminding me. Its now working... Thank you TPR.
-
Which css files would that be? I've tried AdminOnSteroid.css, AdminOnSteroid.css. It didn't show anything. Oh I forgot to mention I use Reno theme too.
-
And How could I do that? If I knew enough about building modules (hopefully one day), I'd create something like this for page tree on parent setting or somehow.
-
With Reno theme and AOS Installed, The accordion is disabled on sidebar which is really good. But... unfortunately, the accordion does not affect on page tree. It gets really pain to click on parent to expand child. Especially with my clients that think there isn't any child to do editing. Is there a way to disable it?
-
Glad to know your issues have been solved, Blending Bootstrap with CMS can become cumbersome and time consuming. At least you probably have learned something about PW. Here's list UI framework, "a lighter version of bootstrap". - Kube - Pure - Skeleton - Concise and many more...You can even build your own framework yourself.
-
main.js:50 Uncaught TypeError: jQuery(...).scrollingTo is not a function(…)(anonymous function) This mean .scrollingTo is not a JQuery API function or never recognized as official function. If there is/are another Javascript fie that creates .scrollingTo as function, make sure script source url is included at bottom of HTML before end of <\body> or the url of script doesn't have typo error... I have strong feeling it should be .scrollTo instead. have a look here
-
@MaryMatlow I believe you have used bootstrap navigation structure, correct me if I am wrong? So you said, it worked when you remove data-toggle attributes. Your issues could be more likely to conflict between data-attribute and JS/JQuery since you assigned multiple data-toggle attributes. I could be wrong, only way to know is open web-dev console tab and see if you have encountered error. Here other thing... Can I suggest your code structure to look like this... <nav class="collapse navbar-collapse navbar-right" role="navigation"> <div class="main-menu"> <?php $treeMenu = $modules->get("MarkupSimpleNavigation"); // load the module $options = array( 'has_children_class' => 'dropdown', 'max_levels' => 2 selector' => 'template!=MediaLibrary', 'outer_tpl' => '<ul class="nav navbar-nav">||</ul>', 'inner_tpl' => '<div class="dropdown-menu"><ul>||</ul></div>', 'item_tpl' => '<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" aria-controls="navbar" href="{url}">{title}</a>', 'item_current_tpl' => '<a class="current" href="{url}">{title}</a>', ); echo $treeMenu->render($options); // render menu ?> </div><!--end of .main-menu--> </nav> I haven't tested it yet, but you don't really need to have <nav>. <div> inside MSN, since MSN is specifically for <ul><li> and <a>..
-
@MaryMatlow I believe this is an active community here... Let make it lot clear for you. Here what you did... <?php $nav = $modules->get("MarkupSimpleNavigation"); $nav_options = array( 'list_tpl' => '<li class="dropdown">||</li>' ); echo $nav->render($nav_options); ?> The result... <nav> <ul> <li class="dropdown">...</li> <li class="dropdown">...</li> <li class="dropdown">...</li> /*has children*/ <ul> <li class="dropdown">...</li> <li class="dropdown">...</li> <li class="dropdown">...</li> <li class="dropdown">...</li> </ul> <li class="dropdown">...</li> </ul> </nav> Entire <li> is getting class called dropdown, even it will override <li> default class. Now if you change this... <?php $nav = $modules->get("MarkupSimpleNavigation"); $nav_options = array( 'has_children_class' => 'has_children dropdown', ); echo $nav->render($nav_options); ?> The result will show <li> with children contain two classes "has_children" and "dropdown" just like @Robin S showed you. <nav> <ul> <li>...</li> <li>...</li> <li class="has_children dropdown">...</li> /*has children*/ <ul> <li>...</li> <li>...</li> <li>...</li> <li>...</li> </ul> <li>...</li> </ul> </nav> You can as well use only one class name "dropdown" this.. <?php $nav = $modules->get("MarkupSimpleNavigation"); $nav_options = array( 'has_children_class' => 'dropdown', ); echo $nav->render($nav_options); ?> and it will assign <li> with only class name "dropdown" as result... <nav> <ul> <li>...</li> <li>...</li> <li class="dropdown">...</li> /*has children*/ <ul> <li>...</li> <li>...</li> <li>...</li> <li>...</li> </ul> <li>...</li> </ul> or leave blank.... <?php $nav = $modules->get("MarkupSimpleNavigation"); ?> the result still will show <li> with children with default class "has_children" since MSN detects existing children <ul> <li>...</li> <li>...</li> <li class="has_children">...</li> /*has children*/ <ul> <li>...</li> <li>...</li> <li>...</li> <li>...</li> </ul> <li>...</li> </ul> Hope this one really helps.
-
It worked! You did your best! thousands of thanks .
-
You are amazing... Thank you.
-
Thank you for sharing. Now the management is lot easier. Every Time my client click on select image they get confused about image management because "Media Library" dropdown is always closed. Is there a configuration to keep Media Library dropdown open all of time?
-
@klenkes -- Wait a min... which dragonfly are you talking about? the presto based or chrome? I loved presto based, they were awesome. I loved Firefox dev tools, unfortunately there were so many inaccuracies, there weren't much updates on FF dev tools lately. @AndZyk, yes I am aware about disabling cache in dev tools. It didn't really work most of time. Well, I guess Ctrl+Shift+Del or getting chrome apps called clear cache is the solution for now.
-
I am having cache issues when working on template style using chrome browser at localhost with local server running. There are time color or size didn't change when I save css and reload chrome page. Sometimes to solve problem, I'd have to hit ctrl + alt + save to clear cache from browser. I've looked up Admin > Setup > Template > Cache Tab and noticed cache was already disabled as default. I have already looked into this article http://www.flamingruby.com/blog/processwire-caching-explained/ But realized it has nothing to with my issues and it got me confused rather its a browser or PW issues, does anyone have similar experience in past and probably found a solution? if so please share some suggestion. Thanks in advance.
-
I see your problem, this array string below... 'list_tpl' => '<li class="dropdown">||</li>' Overrides has_children class as default. And this string will add 'dropdown' class to whole element that has <li>. Use this string... 'has_children_class' => 'has_children', If you only want to change <li> classname that have children only. BTW, you don't really need to input entire stack of arrays since the list are already default, only randomly pick one that need to override it's defaults. Hope that helps
-
Try to change this.... 'show_root' => true, Hope that helps. EDIT: Disregard this message above, I misread... Did the source code you posted came from browser developer mode? Or have you try to see 'has_children show up in developer mode like my case (chrome browser)?
-
Wow...so simple, it worked! Oh yes I remembered that example, But I thought that was for element like button only. After you added comment '...return any markup' , Now, I am duly noted, Thank you. After looking at this document , I believe am getting somewhere about hook functionality. But, I am struggling to understand what is 'getItemString' , what does it do? I changed it name into 'test' and it does not affect anything. $nav->addHookAfter('getItemString', function($event) this one, ('page') too... $page = $event->arguments('page'); Lastly... I understand $page->parent->id means home page, And the == 1 ?? does it mean home page too? please help me understand. if($page->parent->id == 1)
-
Oh yes I know about preg_replace(), I did this before when I built contact form with validation back then. But I never really got deep into it. What I mean, I was wonder if there are some examples on preg_replace() and MarkupSimlpleNavigation all together? so I can get idea where to start, Hope you come back and can help me to get warm start. While at it, I just played around with JQuery ... $("a[href='#drop1']").attr('href', '/dropdown/drop1'); This string worked! it did replace PW page url, got this page to load into another page. But again... This not going to be good solution for my future clients. if every time clients decide they want to add new sub pages especially with different names, I'd have hard code on jQuery. I was looking for maybe an easy alternative, more of the MSN way, overriding/replace href like this code 'item_tpl' => '<a href="#{name}">{title}</a>' but for subpages, and it can be multiple based on specific name. Dreaming too much am I? or maybe I should make requisition to Soma.
-
Hi I realize I got you confused again, probably... it have been overwhelming week for me... From the last post... Drop1 - (jump into same page section) → ?? 'item_tpl' => '<a href=" {url}">{title}</a>' (address bar expected to show) → /#dropdown/drop1 Drop2 - (jump into same page section) → ?? 'item_tpl' => '<a href=" {url}">{title}</a>' (address bar expected to show) → /#dropdown/drop2 Correction.... (see orange bold)... Drop1 - (jump into another PW page) → ?? 'item_tpl' => '<a href=" {url}">{title}</a>' (address bar expected to show) → /#dropdown/drop1Drop2 - (jump into another PW page) → ?? 'item_tpl' => '<a href=" {url}">{title}</a>' (address bar expected to show) → /#dropdown/drop2 Sure, here's what I have so far... <nav> <?php $nav = $modules->get("MarkupSimpleNavigation"); $nav_options = array( 'show_root' => true, 'outer_tpl' => '<ul class="nav">||</ul>', 'inner_tpl' => '<ul class="drop">||</ul>', 'item_current_tpl' => '<a href="#{name}">{title}</a>', //home 'item_tpl' => '<a href="#{name}">{title}</a>', // ...nav menu after current (home) echo $nav->render($nav_options); ?> </nav> And the results in picture explains it all Everything there is perfect with hash in anchors, I am able to get same page jump after clicking on Home, About and Contact. But with two dropdown menus (drop1 and drop2) I would need to get that hash in achors replaced with URL so Drop1 and Drop2 can go into next PW page as mentioned in picture (The greenbox part) "First Level"?? I not sure I get that but am guessing you mean the visible in menu i.e. Home, About, Contact and Dropdown? Oh I could do hardcoding, I could write something like this <li><a href="/drop1/"><?php page->title ?></a></li> for my personal website perhaps. But, for my future clients, that know nothing about coding, I don't think hardcoding would be best option. Especially if client decided to add new page for dropdown menu (drop3). MarkupSimpleNavigation would probably be best solution unless, there are other options, perhaps with PW's original navigation code? Could you demonstrate me example with code... or point out some document around? I couldn't find anything on preg_replace() in search. I don't really have much knowledge in php and would love to learn more about it.
-
@blynx -- Thank you for taking time to respond... Maybe I wasn't much clear on what I was looking for... Here let me explain it better. From demo menu as showed from earlier post... Home About Dropdown Contact Drop1 Drop2 The goal for was to get Home, About, Dropdown and Contact to jump into section on same page except for Drop1 and Drop2. Instead of #drop1 it need to have url link to another page. so... Home - (jump into same page section) → 'item_tpl' => '<a href=" #{name}">{title}</a>' (address bar shown) → /#home/ About - (jump into same page section) → 'item_tpl' => '<a href=" #{name}">{title}</a>' (address bar shown) → /#about/ Dropdown - (jump into same page section) → 'item_tpl' => '<a href=" #{name}">{title}</a>' (address bar shown) → /#dropdown/ Drop1 - (jump into same page section) → ?? 'item_tpl' => '<a href=" {url}">{title}</a>' (address bar expected to show) → /#dropdown/drop1 Drop2 - (jump into same page section) → ?? 'item_tpl' => '<a href=" {url}">{title}</a>' (address bar expected to show) → /#dropdown/drop2 Contact - (jump into same page section) → 'item_tpl' => '<a href=" #{name}">{title}</a>' (address bar shown) → /#contact/ The 'item_tpl' => '<a href="#{url}">{title}</a>' almost worked, except it did not get Drop1 or Drop2 from Dropdown into another page after click. yet 'item_tpl' => '<a href=" #{name}">{title}</a>' it worked too, but it assign # to entire menu list including Drop1 and Drop2 which I did not want that. I wanted URL instead... Your suggestion #{name} instead of #{url} is lot better since it doesn't require page load and its jumps into section on same page quickly after pressing on menu. I'm going to stick #{name}, Thank you for your suggestion. I tried your suggestion #{name}-{id} to set up as unique identifier, it didn't work, jump into section on same page, Link shows changes inside address bar. I am gonna guess this have something to do with section ID such as <section ID="<?php ... {name}--{id} ?>? I've tried href={url}#{name} same issues, it did not jump into another section or to next page with link, except showing change in address bar with page name and ID changes. I've tried this.... 'xtemplates' => '', // specify one or more templates separated with a pipe | to use the xitem_tpl and xitem_current_tpl markup 'xitem_tpl' => '<a href="{url}">{title}</a>', // same as 'item_tpl' but for xtemplates pages, can be used to define placeholders 'xitem_current_tpl' => '<span>{title}</span>', // same as 'item_current_tpl' but for xtemplates pages Nothing works as expected. Still trying to figure out how to make a exception replacement of # to url on child of dropdown menu... Hope you can help
-
Guys, Thank you for your replies... Your idea and suggestion helped me. @deltavik -- instead of fields, I've used get page and render template method. You can see below here. @Webrocker -- I must admit, I don't have strong knowledge in PHP, this is why I used mix php/html method for now. However, your method seem to be Interesting, I certainly, I would try that for next experiment project so I could gain more knowledge. For now, I'd stick with "mixed" html/php, Thank you for excellent tips. @blynx, Your code with MSN, this is what I did entire rainy weekend (see below). except for {id} part, that something I want to dig into. I believe this would help. Here's what I did on single page using markup simple network.... /*Nav*/ <nav class="responsive"> <?php $nav = $modules->get("MarkupSimpleNavigation"); $nav_options = array( 'show_root' => true, 'outer_tpl' => '<ul class="nav">||</ul>', 'inner_tpl' => '<ul class="drop">||</ul>', 'item_current_tpl' => '<a href="#{url}">{title}</a>'// for Home page(Current) 'item_tpl' => '<a href="#{url}">{title}</a>', //for Child page ); echo $nav->render($nav_options); // render the menu ?> </nav> /*Home Page*/ <section id="/"> <?php $sec_a = $pages->get('/SectionA/'); $sec_Rendered = $sec_a->render('single/sec_a_tpl.php'); echo $sec_Rendered; ?> </section> <section id="sectionB"> <?php $sec_b = $pages->get('/SectionB/'); $sec_Rendered = $sec_b->render('single/sec_b_tpl.php'); echo $sec_Rendered; ?> </section> <section id="sectionC"> <?php $sec_c = $pages->get('/SectionC/'); $sec_Rendered = $sec_c->render('single/sec_c_tpl.php'); echo $sec_Rendered; ?> </section> this works flawless, I am able to get this to scroll up/down when pressing each menu list... except for one thing... The drop down menu become "inactive". Here's whats on my menu... Home About Dropdown Contact Drop1 Drop2 I confirmed when viewing address bar /#/dropdown/drop1 and realized, since I've added this string in array'item_tpl' => '<a href="#{url}">{title}</a>' it it affects entire main menu including Dropdown from going into another page but seeking for /#/dropdown somewhere. The main goal was get entire menu to scroll down using item_tpl except for dropdown. So, I wonder... are there any way to exclude only one menu (dropdown) from getting # using Markup Simple Navigation? Any suggestions? Thanks in advance.
-
Thank you!
-
@Bitpoet: The error worked now, I am able to see it in PW when I encounter error. Now I am able to troubleshoot better. Now with these $pages->get() and ->render Finally, I am seeing dots connecting together... The more I play around, the more I understand how it work. I didn't realize its not that difficult. It just remind me a little bit of Javascript. API is getting clearer for me now after spending hour playing around with it. I wanted to thank you so much for your help, I truly appreciate it. I wish I knew how to add + to your reputation, I couldn't find anywhere in this fourm. Once again Thank you.
-
@bitpoet: Thank you for taking time to answer. Retriving page worked! I had that retrieve page code at the first time but without adding fields <?= echo $page->summary ?> and etc which is why I thought it didn't work first time. Actually, I thought retrieving page string would just would just grab entire page at once just like mirroring. Yes, I've went through these example with links you have suggested... I got really more confused after trying string from this link Here's the code... <?php $getPages = $pages->get('/contact/'); /*from: contact page*/ $renderPage = $getPages->render('/');/*to: home page (current)*/ echo $renderPage; /*render contact page in home page */ ?> and I end up getting internal server error. I couldn't ID the problem with the code. I hope this one you can help me out clearing this up for me. Thank you. @BrendonKoz: I can't tell you how many times I have read or went through entire document on selectors. I always end up struggling with it, I've perform many tries and test by following document. I always face server error or not getting any results, there was no way I could troubleshoot or ID them without explanation unlike when I've done it with JS and Ruby. Since Php isn't my strong area of expertise, Its not that I don't understand what those documents are saying, I just cannot connect the dots or get picture in my head when they aren't much of examples. No way I could know rules or proper way to write code from API documents. For example I didn't know I need to retrieve the page first in order to view other page contents in this page and add specific fields, type and value. I couldn't find any example or document in this forum or anywhere or at least, maybe I've missed it. Without much of examples on API syntax or rules. I get lost or confused. I didn't have problem picking up syntax and API after I took tutorial written by Ryan Cramer, Joss Sanglier, and Ben Byfor, The step by step examples are clear and after that I am able to understand API document while comparing to tutorial examples. What would be your suggestion for me to be able to understand how to write API syntax? Truly appreciated your advice, thank you. @thetuningspoon: I am aware of syntax error... However the main error was not retrieving page. Thank you.
-
I've spend couple of hours figuring out how to have entire page content display into another page section for example... Page 1 ------------------------------- $page -> title; $page-> summary; $page->message; ------------------------------ into... Page 5 ------------------------------------ <section> <!-- Other codes here--> </section> <section class="page1"> $page -> title; $page-> summary; $page->message; </section> <section> <!-- Other codes here--> </section> -------------------------------------- I've tried this code inside Page 5. <section> <h1><?php echo page->title; ?></h1> <p><?php echo page->summary; ?> <br> <?php echo page->message; ?> </p> </section> None of content show up on page 5 from page 1. I later realize $page->fields inside page 5 would only show fields on current page (page 5) not from page 1. And certainly page 5 does not have page 1's fields. Any suggestions and your help is truly appreciated.