-
Posts
2,776 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
New Template Method: Does this make sense to do it this way?
Macrura replied to joer80's topic in API & Templates
@joer80 - sounds interesting, and i support the idea of some profiles that have configurable things like page layouts, widgets, etc.. I've done some similar things as you are speaking about, in order to create a reusable profile, and we'll see how it goes once i start reusing some of these.. been looking at this the last day or so.. http://designmodo.com/startup/ -
all really nice, very original designs - you've been really busy!
-
hey - anyone using/tried google web designer?
-
yeah, it works really well... probably should make this into a module at some point, for wider accessibility
-
hey - try out the new function i replaced the code i posted; should work now..
-
yeah - sorry forgot to tell you how to echo it.. that should work in think, but you can also do this: $root = $pages->get(1); $pa = $root->children(); echo renderChildrenOf($pa,$root); didn't test that code so not totally sure it will work yet... will try and test later...
-
here's a first try though untested as of yet... worked on this a bit... /** * render markup menu for bootstrap nested navigation * * @param PageArray $pa pages of the top level items * @param Page $root root page optional, if you use other root than home page (id:1) * @param string $output for returned string collection * @param integer $level internally used to count levels * @return string menu html string */ function renderChildrenOf($pa, $root = null, $output = '', $level = 0) { if(!$root) $root = wire("pages")->get(1); $output = ''; $level++; foreach($pa as $child) { $has_children = count($child->children()) ? true : false; $opening = ''; $closing = ''; if($has_children && $child === $root) { $output .= "\n\t<li><a href='{$child->url}'>{$child->title}</a></li>\n"; } if(!$has_children) { $output .= "\t<li><a href='{$child->url}'>{$child->title}</a></li>\n"; } if($has_children && $child !== $root) { if($level == 1) { $opening = "\t<li aria-haspopup='true'>\n<a href='{$child->url}'>{$child->title}</a>\n<div class='grid-container12'>\n"; $closing = "</div>\n</li>\n"; } if($level == 2) { $opening = "\n<div class=\"grid-column3\">\n<h4>{$child->title}</h4>\n<ul>\n"; $closing = "</ul>\n</div>\n"; } } $output .= $opening; // If this child is itself a parent and not the root page, then render its children in their own menu too... if($has_children && $child !== $root) { $output .= renderChildrenOf($child->children(), $root, $output, $level); } $output .= $closing; } return $output . "\n"; } it's also easier in this case to specify the outer markup and let the function do the rest.. $root = $pages->get(1); $pa = $root->children(); $pa->prepend($root); echo '<ul class="mega-menu">'; echo renderChildrenOf($pa,$root); echo '</ul>'; but probably you'll need to work on it because this really only works with that exact page tree structure..
-
you could definitely modify the code that was originally made by Soma, to do this.. https://processwire.com/talk/topic/2787-custom-menu-not-related-to-page-tree/?p=27275 i can make you a function do do what you need later on..
-
but a slide could be a template, where each slide is one page, or the slider could be a template where the slides themselves are repeaters or page table, or images with regular or extended fields. the only way to get the page to be configurable how you want is to use the page table extended
-
does it work if you disable the hanna code on that? i'm guessing from what you are saying, no...
-
right - ok cool.. i'm sure once you see how easy it is to build a mega menu with PW you'll be awestruck... so initially to get it going, can you provide some details of the page structure, and whether you want to build a custom menu or build the menu off pages..
-
if you're asking about how to structure the code to output that markup, then i can say that if i had to do a mega menu, i would setup a page tree branch for the menu items and use fields and templates to create the nested structure you need; either that or use options/page selects to specify the structure and then create a function to parse the pages into the megamenu if you could post your current code that might help... it really comes down to where you're getting the pages from and where these headlines are coming from... are they the parent page of the menu item, or parent page of a page that you're pulling into the menu
-
does team body have hanna code formatter enabled?
-
maybe this could work? http://modules.processwire.com/modules/fieldtype-page-table-extended/
-
Released: PadLoper (commercial eCommerce platform for ProcessWire)
Macrura replied to apeisa's topic in Modules/Plugins
ended up using this: http://css-tricks.com/snippets/php/generate-expiring-amazon-s3-link/ so i have a processwire page that checks to see if the url to the download is still valid (# of clicks, or date expiration) and then this one liner generates the link to the file on s3, which expires anyway in 5 minutes, and is authenticated. $fileUrl = el_s3_getTemporaryLink($key, $secret, $bucket, $awsPath); i would think it would be pretty easy to 'override' the local storage of a download in padloper with this function and then redirect the browser to the aws file url... -
Released: PadLoper (commercial eCommerce platform for ProcessWire)
Macrura replied to apeisa's topic in Modules/Plugins
yeah, i'm hoping to do the same thing, where the file is hosted on s3; only issue i can think of is this would have to be done with a header redirect, and then anyone viewing the console would be able to see the raw s3 URL (?).. but i probably don't know enough to say for sure.. -
@netcarver - thanks, yes, this fixed it!
-
@nik, great and essential module, using it all the time; Also learned from your code and was able to create some other modules that add their own tab. One question though - is it possible to add the tab before the view link? Then when you click it, the buttons for save would be able to stay below the tab frame.. i guess it would somehow need to append the tab before the save button and view links...
-
using that would have required using html files; where with the way my docs 'system' works, it is all being done with pages, so users can add and modify existing docs, links docs by template or page.. much easier!
- 15 replies
-
- 3
-
-
- responsive
- ajax
-
(and 2 more)
Tagged with:
-
@mr-fan, using PW pages for the docs, not html files; and then this module pulls them into the docs tab: https://gist.github.com/outflux3/3e76a1338b61d708157c posted also more here.. https://processwire.com/talk/topic/8392-simple-built-in-docs/?p=86813
- 15 replies
-
- 1
-
-
- responsive
- ajax
-
(and 2 more)
Tagged with:
-
Using this module, in combination with the Template Select module, it is easily possible to show inline related documentation on the edit page. Same setup as above, but adding the template select field on the doc template. could also be further modified to support showing a doc only on a specified page, or children of a page, using selector fieldtype.. example module https://gist.github.com/outflux3/3e76a1338b61d708157c
-
@cstevensjr - yes, it's super easy, this how i do it... 1.) in site plugins, upload the entire SM2 folder that can be downloaded here: http://www.schillmania.com/projects/soundmanager2/doc/download/ 2.) create an alias variable in the init or in config to the plugins folder, e.g. config: $config->plugins = '/site/plugins/'; or $config->plugins = '/site/templates/plugins/'; or _init $pluginFolder = $config->urls->templates . 'plugins/'; note - this example is using both the player buttons and the bar-ui, thus loading both.. IN THE HEAD <link rel="stylesheet" href="<?=$pluginFolder?>sm2/css/mp3-player-button.css" type="text/css" /> <link rel="stylesheet" href="<?=$pluginFolder?>sm2/css/bar-ui.css" type="text/css" /> in foot <!-- Soundmanager2 ============================================= --> <script type="text/javascript" src="<?php echo $pluginFolder?>sm2/script/soundmanager2-nodebug-jsmin.js"></script> <script type="text/javascript" src="<?php echo $pluginFolder?>sm2/script/mp3-player-button.js"></script> <script type="text/javascript" src="<?php echo $pluginFolder?>sm2/script/bar-ui.js"></script> <script> soundManager.setup({ // required: path to directory containing SM2 SWF files url: '<?php echo $pluginFolder?>sm2/swf/' }); </script> where you want to show the player you can copy the markup from the SM2 examples; for mp3 player buttons you just add the class.. "<a href='{$audio->audio_file->url}' title='{$audio->title} (audio preview)' class='sm2_button tip'></a>";
- 15 replies
-
- 4
-
-
- responsive
- ajax
-
(and 2 more)
Tagged with:
-
This is a site for composer, conductor, and NYU composition professor Louis Karchin. http://louiskarchin.com/ The site is based around the works which are presented as a filterable datatable, with inline audio player (soundmanager2).. There is some ajax happening on the works page to pull up details about a work in a popup. a lot of the initial work was importing from the original site as well as from CSV files of the works, so there were various custom import/api scripts used to get all the data in.. As with other recent sites, this site has a admin docs section for reference, as well as inline docs on the edit page, using a simple module based on Nik's page references tab. also this uses the configurable widgets system: and i have an admin page for backups, though the backups run automatically on a cron (using the SmartBackup script): this site benefited from a lot of modules, namely: AdminCustomFiles AdminCustomPages PageDocsTab AdminPageSelectEditLlinks AIOM+ FieldtypeDataStructure FieldTypeTemplates InputfieldSelectExtended HannaCode ProcessRedirects ProcessDiagnostics Profields Table Formbuilder Procache Lister Pro
- 15 replies
-
- 12
-
-
- responsive
- ajax
-
(and 2 more)
Tagged with:
-
@Rinaldi, why not try the bitnami stack, make your site and then once it's done come back for some instructions on how to take it live?