solved Page Module Current ID

SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
RE: Page Module, custom profile pages:
--
We get the current module here:
$_sModuleURL = strtolower($_data['module_url']);
--
Question #1: Is the page ID "2" below unique per profile, or site wide?
Example: MySite/ProfileA/page/2/home
--
Question #2: Is there a JR variable that will give us ID or Name of current profile custom page being viewed?
$_sHOST = strtolower(parse_url($_sURI, PHP_URL_HOST));
We can use raw PHP like above, if we must, but prefer a JR variable.
updated by @softdesigns: 06/18/17 11:09:07PM
paul
@paul
7 years ago
4,326 posts
1) All item IDs in Jamroom, including those of page items, are unique 'site-wide'.

2) Not really sure where you are using this code, so cannot answer atm. Can you give us some detail of what you are doing, and where?

Thanks


--
Paul Asher - JR Developer and System Import Specialist
michael
@michael
7 years ago
7,714 posts
MySite/ProfileA/page/2/home

the 2 corresponds to the _item_id in the jrPage modules datastore. It is unique site wide. The 'home' part of the URL is cosmetic and not used other than for a human user to visualize the url and SEO reasons.

MySite/ProfileA/page/2/home
MySite/ProfileA/page/2/three-birds-in-a-tree
MySite/ProfileA/page/2/wednesdays-i-like-to-bake

Are all exactly the same URL.

--
Not really understanding Question #2. You can use the ID from the URL to retrieve the item from the datastore if its not already there for you in the location you're programming at.

$_item = jrCore_db_get_item('jrPage', 2);

Will get you an array of the data that is attached to item 2 from the jrPage datastore. with that comes all the profile information where that item is stored on.
SteveX
SteveX
@ultrajam
7 years ago
2,584 posts
@softdesigns I might be wrong, but I get the feeling that this doc might be useful to you:
https://www.jamroom.net/ultrajam/documentation/code/1683/reading-the-post


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
Thanks ALL for the great replies...
Quote:
MySite/ProfileA/page/2/home
MySite/ProfileA/page/2/three-birds-in-a-tree
MySite/ProfileA/page/2/wednesdays-i-like-to-bake
Basically, Question #2 - was: What is the easiest way - or a JR variable that contains - that ID "2" in the links above.
--
From the replies, it sounds like just using raw PHP, or "reading-the-post", and parse the URL seems to be the easiest way...
--
Great Support - Solved...
updated by @softdesigns: 03/20/17 05:43:19PM

Tags