solved Quick Share Modal Window - item_share_modal.tpl

PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
I am wondering how I change the tpl format inside the share it modal window?

<div id="share_item_box">
            {if $template}
                {jrCore_list module=$module search="_item_id = `$item_id`" limit=1 template=$template}
            {else}
                {jrCore_list module=$module search="_item_id = `$item_id`" limit=1}
            {/if}
        </div>

The formatting I use for each timeline item does not work inside the modal window.

Thanks for the help! :)


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3

updated by @the-patria-company: 03/19/17 03:25:36PM
PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
Any thoughts on where the $template is set at?


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3
michael
@michael
8 years ago
7,715 posts
usually if things get no response its because whats being asked is not understood.

To help make it understood, use the title to ask the question, then use the text area to provide enough surrounding info for the viewer of the question to be able to understand it. If they can understand it then they can answer if they know the answer.

QUESTION: "Quick Share Modal Window - item_share_modal.tpl"

Its not really clear what you're asking. Its not clear which skin this is for and from the code alone there is no way to know where $template is set. Is this custom code, or default code.
PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
Sorry. Yes, this is the default item_share_modal.tpl found in the timeline module. I just need to know how the $template is supposed to function so that I can make adjustments. For example, can I create a jrModule_item_share.tpl?

Thanks


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3
PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
PatriaCo:
Sorry. Yes, this is the default item_share_modal.tpl found in the timeline module. I just need to know how the $template is supposed to function so that I can make adjustments. For example, can I create a jrModule_item_share.tpl?

Thanks

Can anyone give me a little hint on this please?


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
If the template is called item_share_modal.tpl and it is in the jrAction module:

Create jrAction_item_share_modal.tpl in your skin


--
¯\_(ツ)_/¯ 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 :)
PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
PatriaCo:
I am wondering how I change the tpl format inside the share it modal window?

<div id="share_item_box">
            {if $template}
                {jrCore_list module=$module search="_item_id = `$item_id`" limit=1 template=$template}
            {else}
                {jrCore_list module=$module search="_item_id = `$item_id`" limit=1}
            {/if}
        </div>

The formatting I use for each timeline item does not work inside the modal window.

Thanks for the help! :)

I am actually looking for the code that is called by $template - as I cannot see any reference to it in the datastore.


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3
douglas
@douglas
8 years ago
2,790 posts
I don't think your giving us enough information on what your trying to do.

What skin is this for?
Is there an override template in the skin your trying to change?
What exactly are you trying to change?

Thanks!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
PatriaCo:
Sorry. Yes, this is the default item_share_modal.tpl found in the timeline module. I just need to know how the $template is supposed to function so that I can make adjustments.

<div id="share_item_box">
            {if $template}
                {jrCore_list module=$module search="_item_id = `$item_id`" limit=1 template=$template}
            {else}
                {jrCore_list module=$module search="_item_id = `$item_id`" limit=1}
            {/if}
        </div>

Thanks!


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
Above the share_item_box div, is there a smarty capture code which saves some code to $template?

If so that captured code is your template.


--
¯\_(ツ)_/¯ 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 :)
PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
Exactly! :)

There is nothing. Again this is the default template (item_share_modal.tpl) in the newest version of the timeline module. It has me very confused. I need to make changes to the template that generates the modal window, but I can not figure out how to or better yet, what I should name a custom .tpl as. I am hoping that it works the same the site search, in which each module can have a unique search results template.

Thanks for any help on this mystery! :)


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3

updated by @the-patria-company: 12/15/16 11:54:11AM
douglas
@douglas
8 years ago
2,790 posts
PatriaCo:
PatriaCo:
Sorry. Yes, this is the default item_share_modal.tpl found in the timeline module. I just need to know how the $template is supposed to function so that I can make adjustments.

<div id="share_item_box">
            {if $template}
                {jrCore_list module=$module search="_item_id = `$item_id`" limit=1 template=$template}
            {else}
                {jrCore_list module=$module search="_item_id = `$item_id`" limit=1}
            {/if}
        </div>

Thanks!


The variable for $template is created in the Action modules index.php I believe, don't quote me on that, if it does not get set the value would be "false".

Does that help any?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
michael
@michael
8 years ago
7,715 posts
Steps I take to get the info you're wanting:

* open up PhpStorm with the jamroom codebase project open and run a search for 'item_share_modal.tpl'

That returns 3 locations where that template is used, one is a comment, the other is the birthday module, so im 95% sure the one Im after is the one in the jrAction module.

I open that search result and see this function:
function view_jrAction_share_msg($_post, $_user, $_conf)
{ jrUser_session_require_login(); jrUser_check_quota_access('jrAction'); if (!isset($_post['_1']) || !jrCore_module_is_active($_post['_1'])) { return 'error: invalid module'; } if (!isset($_post['_2']) || !jrCore_checktype($_post['_2'], 'number_nz')) { return 'error: invalid item_id'; } $_temp = $_post; $_temp['module'] = $_post['_1']; $_temp['item_id'] = (int) $_post['_2']; // Does this module have a custom template? $_temp['template'] = false; if (is_file(APP_DIR . "/modules/{$_post['_1']}/templates/item_share.tpl")) { $_temp['template'] = 'item_share.tpl'; } return jrCore_parse_template('item_share_modal.tpl', $_temp, 'jrAction'); }

At the bottom of that function is the location where $template could possibly be set, its this piece of code:
    if (is_file(APP_DIR . "/modules/{$_post['_1']}/templates/item_share.tpl")) {
        $_temp['template'] = 'item_share.tpl';
    }

That piece of code reads: "If the current module which is active from the url contains an item_share.tpl file then use that file"

So the answer to your question is: If the module being shared has provided its own template, then that is used.

--
Modules that provide their own item_share.tpl files can be found again with phpstorm. It tells us that currently only 2 modules do provide that template, they are the jrGallery module and the jrComment module.
PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
OUTSTANDING!!!

Thank you so much @michael :)

I hope this will find its way into some documentation. "How to determine the name of a custom template" (or something similar). This is also great for us new developers.

Slightly off topic, as I am new to PHPstorm. I tried to follow your instructions in order to search for the function. I only see the .tpl files in the search results. How do I see the associated functions in the search results?


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3
michael
@michael
8 years ago
7,715 posts
This won't find its way into documentation, its just some development steps and we're not running a school for developers. ( unless there was interest in that.... )

--
ctrl+shift+f shows the code wide search function. (it has a preview tab). Or you could run the search then click on the result, it has a preview tab too. or you could click on the result and go to the file where you would see the actual function.
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
PatriaCo:"How to determine the name of a custom template" (or something similar).
Turn on Show Template Name in Source in the jtDeveloper module, then look at the source.


--
¯\_(ツ)_/¯ 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 :)

Tags