-
Posts
2,769 -
Joined
-
Last visited
-
Days Won
31
Everything posted by Martijn Geerts
-
You can limit amount of columns and rows in the settings. Handson doesn't let you insert or delete more, and if impotered from csv / json, php cut them off. It's in the fields settings. ( while thinking of it, it might be possible that that is not yet on github, but it's already here on the local install ) Great you're thinking about features. Do you mean: Specify real headers in the config, they gonna be used above the dataset. (not part of the actual dataset) Plus an option to disable add/remove columns at all, so data stays in the right columns ? This all to `force` the client to insert the right data ? if you have better/more ideas, please shout.
-
First idea = great Second = already there, right click On mobile here, will come back on the topic!
-
Very short anser: charts & tables ( where you don't know the amount of columns )
-
What is the shortest way to compare 2 WireArrays?
Martijn Geerts replied to valan's topic in General Support
Gonna do Some investigation when im at home. Thanks for pointing them out. (Should have tested those wile posting, sorry) -
What is the shortest way to compare 2 WireArrays?
Martijn Geerts replied to valan's topic in General Support
sort($array_1); sort($array_2); $same_array = ($array_1 == $array_2) ? true : false; -
What is the shortest way to compare 2 WireArrays?
Martijn Geerts replied to valan's topic in General Support
Jos, like this: yep identical -
One template doesn't recognise any paths, but one works fine
Martijn Geerts replied to JohnHalsey's topic in General Support
Actually I do see now It had a typo. removed the slash here | | <link rel="stylesheet" href="<?php echo $config->urls->templates?>styles/site.css"> -
What is the shortest way to compare 2 WireArrays?
Martijn Geerts replied to valan's topic in General Support
// could be this. if(count(array_diff($array_1, $array_2)) === 0)) { echo "identical" } Others will come up with other clever ideas I think It don't need to sort(), edited the post don't take this as an example, -
One template doesn't recognise any paths, but one works fine
Martijn Geerts replied to JohnHalsey's topic in General Support
site/templates/styles/site.css <-- thats relative, you forget the starting / So if your url is http://my-domain.com/products/, the browser is gonna look for /products/site/templates/styles/site.css This should work: ( see the starting slash ? ) <link rel="stylesheet" href="/site/templates/styles/site.css" /> -
One template doesn't recognise any paths, but one works fine
Martijn Geerts replied to JohnHalsey's topic in General Support
To expand a little on marcus post. the templates folder, usually /site/templates/ (if PW is installed in the root) | +----------------+------------------+ | | <link rel="stylesheet" href="<?php echo $config->urls->templates?>dist/css/main.css"> | | | +-+--+-+-+ / \ / custom folder / named css custom folder named dist had 1 slash to much.. changed -
Kongondo is has a question 4 u!
-
Nothing wrong with foreach... root |--listview // here we are | `--all // template products | |-- item 1 // template product `-- item 2 // template product $products = $pages->find('template=product, parent.template=products'); // it's better to use template in a selector then a name/path. (most of the time) // template defines behaviour, less likely to change then a path or a name if (count($products)) { // only if we have products $out = "<ul>"; foreach ($products as $product) { $out .= "<li>" . "<a href='$product->url'>" . $product->title . // fieldname title "</a><br>" . $product->summary . // fieldname summary "</li>"; } $out .= "</ul>"; echo $out; } There are some people that tell outputting strings is quicker with single quotes, I never tested it, but they are probably right. I do prefer the double quotes, as PHP get not processed inside single quote enclosed strings. I ended up in the past, replacing single quotes so many times to double ones that I get tired of it. (lazy) ProcessWire made me change my quote style technic. Now I always use single quotes for HTML attributes, so I can double quotes around a HTML string.
-
$page: current page function trunc($string, $length) { return substr($string, 0, strpos(wordwrap($string, $length), "\n")); } echo trunc($page->body, 100); // string 100 characters or little less, body field from the current page, cut-of on word This happens all the time, not problem... echo trunc($child->body, 100); ??
-
I can tel you out of experience, if you're using Lorem Ipsum and later on you've to replace it with dutch, (What's not unlikely if I see your info) You'll end with much longer words, and maybe breaking your design. Current Page is always $page or wire('page') or $this->page, that depends on the context. ( Why do you want to have 2 instances of Page ) ?? have you even read the post ? please look up again
-
function trunc($string, $length) { return substr($string, 0, strpos(wordwrap($string, $length), "\n")); } http://stackoverflow.com/questions/79960/how-to-truncate-a-string-in-php-to-the-word-closest-to-a-certain-number-of-chara
-
I don't understand anything of the logic here.. If $child is a Page object why do you try to attach string data from the current page to it. Limiting to an amount of words, doesn't make that much sense. Pneumonoultramicroscopicsilicovolcanoconiosis, Supercalifragilisticexpialidocious, Pneumonoultramicroscopicsilicovolcanoconiosis are long words word count: 6 It's better to limit to an x amount of charachters, but break at a word.
-
It's a bit related and not solving your problem. I had to build a module for a customer, who needed a translation company browse the backend, but don't allow them to edit anything. ( configured at role level ) module: conditional demo mode in the settings you c an add the roles
-
@ryan, It would be nice that it also inherits the data from the fieldgroups_fields.data if that is posible It just looks better
-
If I do understand what you're saying: $output .= count($child->parents) < 2 ? renderChildrenOf($child->children, $root, $output, $level) : ''; ps, didn't test the code
-
tnx, bruv
-
I always let Raymond do the work and I take the honor.
-
All inputfields are sanitized, except for password. If you want to sanitze and not really validate. ProcessWire has the $sanitizer. I do use the $sanitizer->email($value) sanitizer as validator to, as it blanks out invalid adresses. if (!$sanitizer->email('bweugh')) { echo "Oops I'm something else"; }
-
ZZ-Ray ?
-
You should do it more often @PapaBear: what the hell is "Ta, bruv...."
-
New kid in class with "is this the CMS for me?" questions...
Martijn Geerts replied to PhotoWebMax's topic in Getting Started
When the switch from Evo to Revo happened, lot's of folks were looking around. Revolutions backend was slow, there were numeral bugs and documentation was scarce. And there you had that new kid in town called ProcessWire with lots of similarities between them. (a reason why so many switched if you asked me) In my opinion ProcessWire is a better experience for the developer and the site editor. Then you're forced to use PHP, not some kind of `pet keeping` safety language. This insures you that learn the most used language of the web, knowledge what you can use everywhere, not only in the ProcessWire world.