Oct 07, 2008, 02:23 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Donate to MODx: Donations
Pages: 1 ... 9 10 [11] 12 13 ... 15   Go Down
  Print  
Author Topic: Support/Comments for PHx  (Read 41065 times)
0 Members and 1 Guest are viewing this topic.
MEGU
Committed to MODx
*****
Posts: 817



WWW
« Reply #150 on: Jul 06, 2007, 03:24 AM »

> Dear netProphET

Thank you for answering my comment.
Quote
I tried TobyL's mod http://modxcms.com/forums/index.php/topic,14306.msg96738.html#msg96738,
and it did not do the trick.

I thank that you gived me valuable information.
I readed the thread which you showed.
I think also that my trouble is the same as that.

I tried TobyL's hack too.
But it did not work for me..

Sincerely yours,
Logged
ncrossland
Testers
*
Posts: 165


« Reply #151 on: Jul 13, 2007, 06:29 AM »

FYI: using the hack will result in  PHX not being recursive.
The reason phx takes on the placeholders is because it needs to resolve the value when they are nested.


I haven't incorporated this hack for this reason. BUT I've uploaded a new version (2.1.3) which includes the "get modifier from file" functionality.
Logged
netProphET
Coding Team
*
Posts: 291


Time is Art


WWW
« Reply #152 on: Jul 16, 2007, 04:18 PM »

PHx is prohibiting me from specifying a Chunk name with a TV.
ex. {{[*right-hand-images*]}}

It seems to me that 2 problems have surfaced for users of PHx
- using placeholders as snippet parameters
- using a template variable as the name of a Chunk

I would love to see a list of any other similar issues. It feels like there might be others. Are these issues being addressed or do they underscore an incompatibility - in order for PHx to achieve what it does, it makes certain feats of the core MODx parser impossible? If the former is true, I think there should be some sort of official disclaimer within the PHx distribution. Maybe with the rewrite of the core for 0.9.7, this will all go away, so expending energy on it for 0.9.6 is not worthwhile?

Any thoughts on this are appreciated.
Logged
myan24
Full Member
***
Posts: 117

I love MODx!


« Reply #153 on: Jul 20, 2007, 08:32 AM »

Hi,

When using ditto I'm trying to display a ditto template if the user is logged in and another if a user isn't logged in. The purpose being that only registered users can view the full document. Here's what I have which seems to work, but I wondered if anyone who has more experience could tell me if this is the best way to do it and if i've done it right:

Code:
[+phx:userinfo=`id`:gt=`0`:then=`
<h3>[+pagetitle+]</h3>
<p>[+introtext+]</p>
<p><a href="[~[+id+]~]">View details</a></p>
`:else=`
<h3>[+pagetitle+]</h3>
<p>[+introtext+]</p>
<p><a href="[~36~]">Login to view details</a></p>
`:strip+]

Document id 36 is a login page.

Thanks for any input!!

Logged
pixelchutes
Coding Team
*
Posts: 801



WWW
« Reply #154 on: Jul 27, 2007, 08:46 PM »

Is it possible to leverage Ditto's pagination placeholders when PHx is enabled? Yes!

I am using v2.1.3, and PHx gets to my placeholders before Ditto even has a chance Sad

Sadly, http://ditto.modxcms.com/tutorials/phx-and-nested-tags.html doesn't account for "non-PHx nested placeholders"...

ditto_pages Chunk:
Code:
<div id="ditto_wrapper">
    <div id="ditto_pages">[+articles_previous+] [+articles_pages+] [+articles_next+]</div>
    <strong>[+articles_total+]</strong> Total Articles<br/>
</div>

Update:

The only work-around I was able to get to work was to actually place the chunk & placeholders inside of a snippet:

Code:
<?php
$html
='<div id="ditto_wrapper">
    <div id="ditto_pages">[+articles_previous+] [+articles_pages+] [+articles_next+]</div>
    <strong>[+articles_total+]</strong> Total Articles<br/>
</div>'
;

return
$html;
?>


So, rather than having to store HTML in the snippet, I am going to rewrite it to pull from the chunk I was using before anyway:

Code:
<?php
return $modx->getChunk( 'ditto_pages' );
?>


And that worked! Cool

Now I can keep my code separate, and edit the chunk as I would normally, and PHx behaves nicely with my Ditto placeholders Smiley
« Last Edit: Jul 27, 2007, 09:07 PM by pixelchutes » Logged

Mike Reid - www.pixelchutes.com
MODx Team Member / Contributor
[Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
________________________________
Where every pixel matters.
netProphET
Coding Team
*
Posts: 291


Time is Art


WWW
« Reply #155 on: Jul 27, 2007, 10:24 PM »

Interesting, Pixelchutes. I used the same kind of solution to solve my problem, which had nothing to do with Ditto.
Problem: with PHx, I became unable to specify a Chunk directly with a TV, like this:
Code:
{{[*right-hand-images*]}}

Solution: so I wrote a snippet whose job it is to simply return a chunk, essentially like your snippet code. Then, to duplicate the functionality of the call above, I just need to change the call to this:
Code:
[[returnChunk? &chunk=`[*right-hand-images*]`]]

This might be the basic pattern to solving this general problem introduced by PHx.
Logged
pixelchutes
Coding Team
*
Posts: 801



WWW
« Reply #156 on: Jul 29, 2007, 12:59 PM »


This might be the basic pattern to solving this general problem introduced by PHx.


What if PHx used different identifiers (or was able to be custom defined) other than [+ and +]? It would seem anything that NEEDED PHx modifiers/functionality could leverage PHx parser's identifiers, while regular placeholders used the MODx default ones?

I know this would solve at least 3 issues I have personally ran into, which involve Ditto, eForm, and your chunk example above...
Logged

Mike Reid - www.pixelchutes.com
MODx Team Member / Contributor
[Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
________________________________
Where every pixel matters.
rthrash
Foundation
*
Posts: 9,269



WWW
« Reply #157 on: Jul 29, 2007, 05:50 PM »

Great point Mike. Sounds like a good consideration for a future release.
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
netProphET
Coding Team
*
Posts: 291


Time is Art


WWW
« Reply #158 on: Nov 07, 2007, 10:35 AM »

This is a vote for adding 2 core extenders to PHx.
- urlencode
- stripslashes
I have made my own extender mini-snippets to provide this functionality. They work fine, but they're just one simple php function, and I'm left thinking that if they were part of the PHx core code, there would be less processing going on.
I am using these functions a lot during form processing (along with the already-defined htmlent processor)... I am able to cut a lot of processing code out of my form handling snippets by moving these processors into the template.
May this also be considered as PHx functionality is integrated into the 0.9.7 core.
Logged
boblin
Jr. Member
*
Posts: 42


« Reply #159 on: Dec 20, 2007, 06:01 AM »

How to avoid cases where i have to use snippet with parameters inside Phx call? The only way i found is to create chunk with such call, but it is against good programing practices imho (-;
Logged
pixelchutes
Coding Team
*
Posts: 801



WWW
« Reply #160 on: Dec 20, 2007, 04:26 PM »

How to avoid cases where i have to use snippet with parameters inside Phx call? The only way i found is to create chunk with such call, but it is against good programing practices imho (-;

Code:
[+phx:input=`[[YourSnippet?&param1=`value1`]]`:is=`...`:then=`...`+]
Logged

Mike Reid - www.pixelchutes.com
MODx Team Member / Contributor
[Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
________________________________
Where every pixel matters.
Marschant
Full Member
***
Posts: 133


« Reply #161 on: Feb 01, 2008, 08:37 AM »

Installed PHx last night to try and get around an irritating Ditto issue only to have all my wayfinder calls that use placeholders die. Here's an example of what I've done:

Code:
[!Wayfinder? &startId=`22` &level=`2` &ph=`currentDevs` &config=`colliers` !]
[!Wayfinder? &startId=`23` &level=`1` &ph=`pastDevs` &config=`colliers` !]
<ul id="leftNav">
<li class="toplevel blue"><a class="toplevel" href="[(site_url)][~1~]">Home</a></li>
<li class="toplevel current"><a class="toplevel" href="[(site_url)][~22~]">Current Developments</a>[+currentDevs+]</li>
<li class="toplevel past"><a class="toplevel" href="[(site_url)][~23~]">Past Developments</a>[+pastDevs+]</li>
<li class="toplevel purple"><a class="toplevel" href="[(site_url)][~10~]">About Colliers</a></li>
</ul>

PHx plugin enabled: zero output...
PHx disabled: menu items are shown...

Any ideas?
Logged
pixelchutes
Coding Team
*
Posts: 801



WWW
« Reply #162 on: Feb 01, 2008, 12:43 PM »

PHx plugin enabled: zero output...

Any ideas?

It's all a matter of understanding how PHx works. Unfortunately, PHx often conflicts with placeholders created by other snippets as it pre-parses the actual placeholder BEFORE it even gets set in the first place.
Logged

Mike Reid - www.pixelchutes.com
MODx Team Member / Contributor
[Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
________________________________
Where every pixel matters.
Marschant
Full Member
***
Posts: 133


« Reply #163 on: Feb 02, 2008, 12:36 AM »

Thanks I understand that issue, I'm really hoping that 0.9.7 will address certain shortcomings with what I consider to be the core MODx snippets: Ditto, Wayfinder & PHx... I mentioned in a previous post (http://modxcms.com/forums/index.php/topic,20811.0.html) my misgivings with Wayfinder (no tv filtering support), Ditto (no native tiered output for parents/children) and now PHx (powerful conditionals & modifiers, prevents use of placeholders).

I'm just getting incredibly frustrated with the limits of each one, MODx is brilliant but has many issues preventing it from being the Numero Uno CMF of choice. Since many projects rely on complex associations, and tv's are the only way to handle this, I feel there are way too many hoops to jump through when trying to get the three snippets mentioned above to work together.

Another issue for me and potentially for clients is local => live synchronisation, hence I'm taking the approach of using as many file system resources as possible i.e. snippets, chunks & partials stored in sub-dir of main template, it just seems easier to FTP new files instead of messing around with a DB synch, anyway I've wandered off-topic...
Logged
luuuciano
Sr. Member
****
Posts: 316


« Reply #164 on: Feb 25, 2008, 08:01 AM »

Hi!

can this be done with phx?

I have a products section, and some products have more details (more photos, made with a maxigallery in a child of each document),something like this:

products
  product1
  product2
  product3
    product3details
  product4
  product5
    product5details
  ...and so on

so, if the product have a child (details) I need a link to it in the non detailed product document...

is there any way to do it?
any idea?


TIA, and sorry for the bad english Smiley

luciano
Logged

---
¡Vamos, todos a usar el canal modx de habla hispana!
irc: irc.freenode.net:6666
canal: #modx-es
Pages: 1 ... 9 10 [11] 12 13 ... 15   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF 1.1.4 | SMF © 2005, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!