Creating &amp; Repurposing Content - MODX Community Forums https://forums.modx.com/board/?board=69 <![CDATA[ [Collections] How to get pagetitle from the id on the collections view ?]]> https://forums.modx.com/thread/103853/collections-how-to-get-pagetitle-from-the-id-on-the-collections-view#dis-post-561321 I have a Collections view with a resource's ID column.
I want to render those IDs with their respective pagetitle.
So I create a snippet called getPagetitleFromID which I call from the Snippet columns view parameter.

But I don't know how to make this snippet code.
I read a little bit xPDO docs but I was a little bit affraid !!!

For now, I have just wrote this but it doesn't work :
$value = $modx->resource->getOne('value');
return $value->get('pagetitle');


Is anyone can help me ?]]>
https://forums.modx.com/thread/103853/collections-how-to-get-pagetitle-from-the-id-on-the-collections-view#dis-post-561321 Sun, 02 Sep 2018 07:24:39 +0000 https://forums.modx.com/thread/103853/collections-how-to-get-pagetitle-from-the-id-on-the-collections-view#dis-post-561321
<![CDATA[pdoField Parent Resource]]> https://forums.modx.com/thread/103820/pdofield-parent-resource?page=2#dis-post-558409
Using a Chunk that returns the SimpleSearch results row I'm trying to include the pagetitle of the (ultimate) parent of each result. Regardless of search criteria there are only 3 possible parent options (resources 2, 3, and 4) at the site root.

I've tried pdoField, UltimateParent and getResourceField but none of them return the correct (ultimate) parent of the search result.]]>
https://forums.modx.com/thread/103820/pdofield-parent-resource?page=2#dis-post-558409 Mon, 07 May 2018 04:44:27 +0000 https://forums.modx.com/thread/103820/pdofield-parent-resource?page=2#dis-post-558409
<![CDATA[createdon date format]]> https://forums.modx.com/thread/103779/createdon-date-format?page=2#dis-post-558277
When I reformat the default createdon date (2018-04-14 01:42:55) to a simple month/day/year I get an incorrect date: February 27, 2015. Not sure where that date is coming from.

I followed Bob's article https://bobsguides.com/blog.html/2013/09/18/displaying-modx-date-fields/.
[[!DateFormat? &field=`createdon` &formatString=`%b %d, %Y`]]
]]>
https://forums.modx.com/thread/103779/createdon-date-format?page=2#dis-post-558277 Sat, 28 Apr 2018 09:45:00 +0000 https://forums.modx.com/thread/103779/createdon-date-format?page=2#dis-post-558277
<![CDATA[Pluralize]]> https://forums.modx.com/thread/103691/pluralize#dis-post-557792
<?php
return  $count > 1?  's' : "";

On the template I use pdoPage to grab all the resources created by a specific user:
[[!pdoPage@pdoPagination?
    &elementClass=`modSnippet`
    &element=`pdoResources`
    &parents=`0`
    &resources=`-1`
    &where=`{"createdby:=":[[!getUrlParam? &name=`author` &int=`1`]]}`
    &tpl=`authorFilter.html`
    &hideContainers=`1`
    &showHidden=`0`
    &toPlaceholder=`results`
    &totalVar=`total`
    &sortby=`{"publishedon":"DESC"}`
    &sortAlias=`1`
    &limit=`6`
    &pageLimit=`5`
    &pageNavVar=`page.nav`
    &totalVar=`page.total`
]]

Then this to display a message:
[[!Profile?
    &user=`[[+createdby]]` &useExtended=`1`
]]
[[+member]] has [[!+page.total]] articles[[!pluralFilter? &count=`[[+total]]`]].


I've compared the problem page with other working pages and don't see any reason why this one page is failing to pluralize.]]>
https://forums.modx.com/thread/103691/pluralize#dis-post-557792 Wed, 04 Apr 2018 09:04:41 +0000 https://forums.modx.com/thread/103691/pluralize#dis-post-557792
<![CDATA[User-selectable Limit]]> https://forums.modx.com/thread/103664/user-selectable-limit#dis-post-557696
Using pdoResources / pdoPage (and pagination controls) to show a listing of resources is there a way to allow a visitor to select the number of results to display using a picker?

Right now I'm using the &limit=`10` property but it's static, I would prefer the value be set from the front-end. For example, the default value might be 10 with additional picker options of 15, 20, Show All. And changing the value would automatically refresh the page.]]>
https://forums.modx.com/thread/103664/user-selectable-limit#dis-post-557696 Wed, 28 Mar 2018 10:10:42 +0000 https://forums.modx.com/thread/103664/user-selectable-limit#dis-post-557696
<![CDATA[Append Paging URL]]> https://forums.modx.com/thread/103665/append-paging-url#dis-post-557632
I'm using pdoResources to list the resources of three different folders, all on a single page. Each group of resources is wrapped in its own parent container with its own id (and pagination). For example:
<section id="one">
…
<resources here>
...
<paging controls>
</section>

<section id="two">
…
<resources here>
...
<paging controls>
</section>

<section id="three">
…
<resources here>
...
<paging controls>
</section>

Works great.

What I would like to do is append the paging url with the id (anchor) of the parent section. So for example, if a paging link in section 3 were clicked the id three would get tacked on like this, mysite/results.html?reviews=2#three or like this mysite/results.html?tutorials=2&reviews=2#three (depending on which and how many sections are being "paged"). This way the user is taken directly to the relevent section on the new page without having to scroll. Anchor 101.

My problem is I'm uncertain how to grab the correct id on the fly and append it. Or if it's even possible.]]>
https://forums.modx.com/thread/103665/append-paging-url#dis-post-557632 Sun, 25 Mar 2018 03:52:33 +0000 https://forums.modx.com/thread/103665/append-paging-url#dis-post-557632
<![CDATA[Adding MODX Combo to Collections list]]> https://forums.modx.com/thread/95984/adding-modx-combo-to-collections-list#dis-post-557016
So far I have the editor set to: {"xtype":"modx-combo","data":["FR","SO","JR","SR"]} but the data does not show up as options. Is it just not implemented? The TV is a dropdown menu so I'd like to only allow the options contained in the TV to be edited from the list.]]>
https://forums.modx.com/thread/95984/adding-modx-combo-to-collections-list#dis-post-557016 Mon, 26 Feb 2018 12:01:33 +0000 https://forums.modx.com/thread/95984/adding-modx-combo-to-collections-list#dis-post-557016
<![CDATA[modxTalks]]> https://forums.modx.com/thread/98412/modxtalks?page=2#dis-post-556183 modxTalks.
Unfortunately the latest version 1.0.4 isn't without errors. Maybe someone can help or has any idea about this?

My system: MODX 2.4.1 | modxTalks 1.0.4 | PHP 5.6.10

1) Error Log:
Table 'modx.modx_modxtalks_mails' doesn't exist
-> solution link

2) Error Log (after solution 1):
(WARN @ /www/htdocs/xxxxxx/modx/core/components/modxtalks/mailer.php) `114` was requested but no alias was located.
(INFO @ /www/htdocs/xxxxxx/modx/core/components/modxtalks/mailer.php) Removed modxTalksMails instance with primary key 10
-> so far no solution found (my russian is not well)

3) MODXTalksPlugin:
It seems the plugin missing the Event "OnModxTalksCommentAfterRemove"?



]]>
https://forums.modx.com/thread/98412/modxtalks?page=2#dis-post-556183 Fri, 05 Jan 2018 10:26:10 +0000 https://forums.modx.com/thread/98412/modxtalks?page=2#dis-post-556183
<![CDATA[getRelated: automatically listing related Resources for Revolution]]> https://forums.modx.com/thread/71009/getrelated-automatically-listing-related-resources-for-revolution?page=9#dis-post-555458
You can install it via the Package Manager.

It has been developed by Mark Hamstra for Vierkante Meter.

Documentation: http://rtfm.modx.com/display/ADDON/getRelated
Bugs & Features: https://github.com/Mark-H/getRelated/issues]]>
https://forums.modx.com/thread/71009/getrelated-automatically-listing-related-resources-for-revolution?page=9#dis-post-555458 Sun, 26 Nov 2017 08:06:15 +0000 https://forums.modx.com/thread/71009/getrelated-automatically-listing-related-resources-for-revolution?page=9#dis-post-555458
<![CDATA[getPage, not showing results]]> https://forums.modx.com/thread/103137/getpage-not-showing-results#dis-post-555107
Situation:

I'm using the Collections addon for my Blog. On my homepage I show the 7 most recent resources. I've created a total of 8.

I intend to use getPage to add pagination.
So with getPage installed, I used the following snippet call inside my home template:

[[!getPage? &element=`getResources` &parents=`2` &limit=`2` &showHidden=`1`]]
                  <ul class="pagination pagination-sm">[[!+page.nav]]</ul>


Result:

I get 4 page results while it should have shown 2! Anyway, then when I click on page 2 of 4, the URL nicely shows:
domain.com/index.php?id=2&page=2


but I get the same page in return, which is page one basically :S

What am I missing?

Thanks,
John]]>
https://forums.modx.com/thread/103137/getpage-not-showing-results#dis-post-555107 Sun, 12 Nov 2017 08:31:51 +0000 https://forums.modx.com/thread/103137/getpage-not-showing-results#dis-post-555107
<![CDATA[Showing future events that are 7 days from current day]]> https://forums.modx.com/thread/103096/showing-future-events-that-are-7-days-from-current-day#dis-post-554946 https://forums.modx.com/thread/103096/showing-future-events-that-are-7-days-from-current-day#dis-post-554946 Sat, 04 Nov 2017 09:44:24 +0000 https://forums.modx.com/thread/103096/showing-future-events-that-are-7-days-from-current-day#dis-post-554946 <![CDATA[Parent(s) list based on children TV]]> https://forums.modx.com/thread/102333/parent-s-list-based-on-children-tv#dis-post-551684 So we have initially:
Parent1
- child_01

- child_N
Parent2
- child_01

- child_N
Parent_N etc.

I want to list only the parent(s) based on its children, if a child has a TV with value set to 1. If there are no children with the TV=1, no parent should be listed.
So, If there one or more children, the relevant parent must be listed. I don't want to list the children, only the parents.

Any ideas to accomplish with getResources or pdoResources?
]]>
https://forums.modx.com/thread/102333/parent-s-list-based-on-children-tv#dis-post-551684 Mon, 12 Jun 2017 08:34:43 +0000 https://forums.modx.com/thread/102333/parent-s-list-based-on-children-tv#dis-post-551684
<![CDATA[Next/previous resource?]]> https://forums.modx.com/thread/102324/next-previous-resource#dis-post-551396
I'm looking at a way to pull the previous/next resource aswell as the page title. I've tried to use BasicNav but it doesn't pull the pagetitle, it's for a news page where you'll be able to go to the previous/next news article.

Thanks!]]>
https://forums.modx.com/thread/102324/next-previous-resource#dis-post-551396 Thu, 01 Jun 2017 12:32:46 +0000 https://forums.modx.com/thread/102324/next-previous-resource#dis-post-551396
<![CDATA[StageCoach Version 1.1.0-pl Released]]> https://forums.modx.com/thread/83043/stagecoach-version-1-1-0-pl-released?page=2#dis-post-551363
StageCoach creates a "staged" version of the Resource that will replace the original at the specified date and time. All you need to do is set the date in the "Stage Date" TV.

The new version has been refactored to use the OnWebPageInit event, which makes it more reliable for use with cached resources. An option to update the publishedon date has been added and some minor bugs have been fixed.

]]>
https://forums.modx.com/thread/83043/stagecoach-version-1-1-0-pl-released?page=2#dis-post-551363 Thu, 01 Jun 2017 04:27:47 +0000 https://forums.modx.com/thread/83043/stagecoach-version-1-1-0-pl-released?page=2#dis-post-551363
<![CDATA[jquery.calendario.js - getresources - daily resource]]> https://forums.modx.com/thread/102184/jquery-calendario-js---getresources---daily-resource#dis-post-550565
I am trying to find the right calendar solution for my needs since the calendars offer through modx arent what Im looking for. (DocCalendar for EVO was almost right except I couldnt figure out how to do daily resources from a single resource).

So Im trying jquery.calendario.js from http://www.codrops.com.

I am able to make a resource event-data.js in modx Revo and have my call in it to grab a date TV, title, resource URL and have it work.

var canvasEvents = {
[[!getResources? &parents=`4` &includeTVs=`1` &processTVs=`1` &tvPrefix=`` &limit=`100` &tpl=`event_js`]]
};


But I have some daily events that I would like to only use a single resource (so I dont have to make 30 resources for 30 days) and show on every day of calendar.

Is this possible? I would pay someone for getting this working now I need it.
]]>
https://forums.modx.com/thread/102184/jquery-calendario-js---getresources---daily-resource#dis-post-550565 Mon, 08 May 2017 12:25:51 +0000 https://forums.modx.com/thread/102184/jquery-calendario-js---getresources---daily-resource#dis-post-550565
<![CDATA[FileLister - Sorting Directories?]]> https://forums.modx.com/thread/78505/filelister---sorting-directories#dis-post-549755
Thanks in advance.]]>
https://forums.modx.com/thread/78505/filelister---sorting-directories#dis-post-549755 Wed, 29 Mar 2017 03:09:46 +0000 https://forums.modx.com/thread/78505/filelister---sorting-directories#dis-post-549755
<![CDATA[pdoTools - pdoPage/pdoResources publishedon/createdon dates not displaying with formatting]]> https://forums.modx.com/thread/101846/pdotools---pdopage-pdoresources-publishedon-createdon-dates-not-displaying-with-formatting#dis-post-549250
Using getPage, I had the following line in my tpl file, which displays the createdon date as "X days X weeks X months ago" and hovering over that text shows the publishedon date in a jQuery tooltip.
<span class="tip date-tip" data-tip="[[+publishedon:strtotime:date=`%b %d, %Y - %I:%M %P`]]">[[+createdon:ago]]</span>


Switching over to pdoPage, my snippet call looks like this:
[[!pdoPage? &parents=`6` &limit=`5` &sortby=`publishedon` &sortdir=`DESC` &tpl=`blogPostSummary`]]


The blogPostSummary chunk looks like this:
<div class="post-summary-box gray-box">
    <h3><a href="[[~[[+id]]]]">[[+longtitle:is=``:then=`[[+pagetitle]]`:else=`[[+longtitle]]`]]</a></h3><a class="comments-link" data-disqus-identifier="page-[[+id]]" href="[[~[[+id]]? &scheme=`full`]]/#disqus_thread">Comments</a>
    <p class="post-info">Posted <span class="tip date-tip" data-tip="[[+publishedon:strtotime:date=`%b %d, %Y - %I:%M %P`]]">[[+createdon:ago]]</span> in [[!TaggerGetTags? &resources=`[[+id]]` &rowTpl=`taggerRowTpl` &separator=`, ` &target=`14`]].</p>
    <div class="entry">
        <p>[[+introtext]]</p>
        <a class="read-more-link" href="[[~[[+id]]]]">Continue Reading</a>
    </div>
</div>


If I use only [[+publishedon]] or [[+createdon]], it displays the date in unix timestamp as expected, however with any sort of output formatting the publishedon tag shows nothing and the createdon tag shows "47 years, 2 months ago". Searching around Google and the forums hasn't produced any issues like mine that I've found.

I appreciate any help!]]>
https://forums.modx.com/thread/101846/pdotools---pdopage-pdoresources-publishedon-createdon-dates-not-displaying-with-formatting#dis-post-549250 Wed, 08 Mar 2017 12:29:49 +0000 https://forums.modx.com/thread/101846/pdotools---pdopage-pdoresources-publishedon-createdon-dates-not-displaying-with-formatting#dis-post-549250
<![CDATA[Where queries on number TVs]]> https://forums.modx.com/thread/101799/where-queries-on-number-tvs#dis-post-549027
I'm using pdoPage to show products with pricing, but when i'm adding a where query i can't get products between a certain price range. Below a simple version of the code:

[[!pdoPage?
&parents=`7`
&depth=`0`
&limit=`4`
&where=`{"TVproductprice.value:>=":250000,"TVproductprice.value:<=":500000}`
&includeTVs=productprice`
&tpl=`product.overview.row`
]]

When filtering on text values it works perfect. When using interget values it does some filtering but it seems like it handels it more like Text than a Interger... does anybody know what i'm doing wrong?

Thnx.

Roald.
]]>
https://forums.modx.com/thread/101799/where-queries-on-number-tvs#dis-post-549027 Tue, 28 Feb 2017 02:59:58 +0000 https://forums.modx.com/thread/101799/where-queries-on-number-tvs#dis-post-549027
<![CDATA[Created resource to be used across multiple contexts]]> https://forums.modx.com/thread/40997/created-resource-to-be-used-across-multiple-contexts?page=2#dis-post-548731
I have a project, it is going to be 6 websites managed by MODx. I know I can do this with contexts. But the kicker is a special thing they want. They want to add a "Service" and that service would appear in all contexts, but they only want to add it once and edit it in one place. So is their a way to add a Resource in the "web" context and have it duplicated or accessible in the other contexts?

So if it is in the web context it would be
www.domain.com/service

but they also want it to show up on the others like
www.domain1.com/service
www.domain2.com/service

Is this possible? I did some research on the ’Babel’ Add-on and it seems like that syncs resources so you can edit the english resource and it will make that modification to all the resources in different languages in their contexts.

Please let me know, this is killing me.

I am using the latest release of MODx 2.0.7]]>
https://forums.modx.com/thread/40997/created-resource-to-be-used-across-multiple-contexts?page=2#dis-post-548731 Mon, 13 Feb 2017 07:26:48 +0000 https://forums.modx.com/thread/40997/created-resource-to-be-used-across-multiple-contexts?page=2#dis-post-548731
<![CDATA[Different behaviour FileLister after upgrade 2.5.1]]> https://forums.modx.com/thread/101135/different-behaviour-filelister-after-upgrade-2-5-1#dis-post-546300 suddenly FileLister on that page adds filesize, lastmod and a 1 or 0 behind the link.

example:
Benelux HeraldN1.pdf 58.45 kb Oct 24, 2016 1
Benelux HeraldNAll.pdf 243.62 kb Oct 24, 2016 0

The 2.4.1 version did not use a chunk but resulted in a perfect link-list.
[[!FileLister? &path=`assets/files/Her/` &outputSeparator=`..br /..` &sortDir=`DESC` &sortBy=`filename`]]

example:
Benelux HeraldN1.pdf
Benelux HeraldNAll.pdf

Everything is the same, but I cannot find the reason for this sudden addition...

Installing chunks for listings does not have any effect, the additions just keep showing up.
]]>
https://forums.modx.com/thread/101135/different-behaviour-filelister-after-upgrade-2-5-1#dis-post-546300 Thu, 10 Nov 2016 09:43:04 +0000 https://forums.modx.com/thread/101135/different-behaviour-filelister-after-upgrade-2-5-1#dis-post-546300