Judah Raine
Total posts: 332
17 Сен 2013 10:46

Hi there, I've noticed something... I have a module that must display on the submission form page for a specific type.

If I access the submission form via a direct menu link to the form (created in menu manager) the module displays.

However, it does not display when accessed via:

a) Submit new item button on the relevant section

a) Submit new item on the relevant section when the section has been accessed via JomSocial.

Is there a setting somewhere that I have missed?

Also, I was wondering if there was a way to make one of the menu items on the JomSocial Toolbar "create" i.e. to link directly to the submission form.

Thank you,

Jude

Последние изменения: 02 Март 2014


pepperstreet VIP
Total posts: 3,837
17 Сен 2013 19:00

Also, I was wondering if there was a way to make one of the menu items on the JomSocial Toolbar "create" i.e. to link directly to the submission form.

AFAIK, the latest JS toolbar is a native J! menu. You can edit and add anything you want. So, you may add a Cobalt submit menuItem. JS docs -> Modifying toolbar


Judah Raine
Total posts: 332
17 Сен 2013 22:35

I did discover that, but I'm referring to the drop down menu for the Cobalt Plugin in the JomSocial toolbar (it has created, bookmarked, followed, etc) I can create a separate link but it would make sense to keep all "library" links together


pepperstreet VIP
Total posts: 3,837
18 Сен 2013 06:51

Regarding your Module display...

Please, check your URLs and appended MenuItemID. Most likely they are different. And you assigned the module to only one of them. I guess, the Cobalt Submit Joomla MenuItem gets his own ID. It is always different than the list and internal links ID. Not sure, which ID is appended to the JomSocial menu... might be the JomSocial Profile page ID?!


Judah Raine
Total posts: 332
19 Сен 2013 10:52

Hi there, as above, I tried going to the submission form from the cobalt jomsocial menu, then copied the url and created a joomla internal menu link using the url as the link. It takes me to the page, but the module still doesn't show up. I tried assigning another module as well, just in case it was this particular one, but nothing shows accessing it via jomsocial module.

The only thing I can think of now is to disable the "add" link in cobalt and create manual links, which does kind of defeat the object of the exercise.

Of course I may have missed something. I'd really appreciate your help, thank you,

jude


Sackgesicht VIP
Total posts: 1,636
19 Сен 2013 18:25

Jude,

if i understand it correctly, you want to display a module on a cobalt TYPE submission page, right?

I would solve the problem on the module level. MetaMod or Advanced Module Manager PRO would help you with his.

If you use Advanced Module Manager PRO, then enter this in your Module assignment under the PHP section:

return (JFactory::getApplication()->input->getInt('Itemid', 0 ) == XXX && JFactory::getApplication()->input->getString('view', 0 ) == 'form');

Replace the XXX with your Menu ID.

MetaMod seems to have a page detection mode (have not tried it) which will show you the needed code to solve your problem. :D


pepperstreet VIP
Total posts: 3,837
19 Сен 2013 18:45

@sackgesicht:

Was about to post the same extensions... ;-)

I wanted to link to another related topic, where we have talked about "load module" in Cobalt template. Unfortunately, I could not find it. Do you have a clue? Benefit: No extra 3rd-party system stuff.


Sackgesicht VIP
Total posts: 1,636
19 Сен 2013 19:26

@pepperstreet

That's one of the Angeldesk problem ... limited search. Unfortunately i don't have the link to it, but i have the code with sergeys comment .. :D

[bThere are also way to do it right in template.

]Edit article template and add column there,

$modules =& JModuleHelper::getModules('customposition');

foreach ($modules as $module)

{

echo '

'.$module->title.'

';

echo JModuleHelper::renderModule($module);

}

Use as parameter your unique position name, And place your modules inside that position. **


Judah Raine
Total posts: 332
19 Сен 2013 21:43

wow, learning curve :D Thanks guys... off to play...


Judah Raine
Total posts: 332
19 Сен 2013 22:25

You guys rock, as always!!! :D Thank you so much, meta mod did the trick...


Judah Raine
Total posts: 332
22 Сен 2013 02:56

Actually, no it didn't... not once I set it to not show on all the other pages. The module works fine unless trying to limit it to the specific form page. The problem seems to be with the specific link to the form from the cobalt category page. As soon as I use the advanced debug, which does indeed gather all the necessary information and generates the php, the module doesn't show.

The problem appears to be the url called when using the "Add Library Here" button on the category page. It calls this url:

http://www.classicromancerevival.com/library/submit/1-library/1-library?return=aHR0cDovL3d3dy5jbGFzc2ljcm9tYW5jZXJldml2YWwuY29tL2xpYnJhcnk=

If I use the link I created to the type submission form it calls:

http://www.classicromancerevival.com/library-submission

and the modules display fine, without the need of metamod.

I see nothing else for it but to disable the button and create my own link


Sackgesicht VIP
Total posts: 1,636
22 Сен 2013 06:13

Judah,

I just installed MetaMod to test your scenario. Using the MetaMod advanced debug mode, it will return** ALL** possible information.

See my example :

if ( 

$option == 'com_cobalt'

and $view == 'form'

and $jinput->get('section_id') == '2'

and $Itemid == '109'

and $jinput->get('cat_user_id') == '53' /*!*/

and $jinput->get('return') == 'aHR0cDovL2xvY2FsaG9zdC9wcm9qZWN0L3JzZC9pbmRleC5waHAb3B0aW9uPWNvbV9jb2JhbHQmdmlldz1yZWNvcmRzJnNlY3Rpb25faWQ9MiZJdGVtaWQ9MTA5'

and $jinput->get('type_id') == '2license'

) return XXX; /* replace XXX with the module ID or position to display */

Now you have to insert your modul ID AND remove some of the conditions.

Assuming you want to display this module on all submissions to this section regardless of user and TYPE, remove the respecive conditions. You will end up with something like this:

if ( 

$option == 'com_cobalt'

and $view == 'form'

and $jinput->get('section_id') == '2'

and $Itemid == '109'

) return 97;  

That should do the trick for you .... :D


Judah Raine
Total posts: 332
22 Сен 2013 07:43

I'm going to compare this with mine and try to see why mine didn't work... a learning curve :D I do appreciate all the help, thank you.

Работает на Cobalt