Primary Category in Suggest Link Form

4 views
Skip to first unread message

Phil -- wbtc.fr --

unread,
Oct 10, 2010, 4:38:59 PM10/10/10
to in-por...@googlegroups.com
Hello,

the suggest_link form used to submit a link consider as first link the
actual place where it have been loaded.
This place is shown by

<inp2:m_RenderElement name="inp_pr_category_label" prefix="l"
field="PrimaryCat" title="lu_fld_SubmittingTo"/>

I've created a professsionnal page, where pro users can manage their
account and links. How can I do to make them deciding the primary
category they link will appears in? I've tried

<inp2:m_RenderElement name="inp_edit_categories" prefix="l"
field="PrimaryCat" title="lu_fld_SubmittingTo"/>

without luck (and I didn't had any hope ^^)

Thanks,
Phil.

Alexander Obuhovich

unread,
Oct 10, 2010, 4:43:16 PM10/10/10
to in-por...@googlegroups.com
There is no such "inp_pr_category_label" block in "advanced" theme.

Primary category is category, passed to link suggestion template. So you need to pass that category in link used to open link suggestion form. That is usually done by "m_cat_id" parameter of "m_Link" tag or any tag, that produces link.
--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Dmitry Andrejev

unread,
Oct 10, 2010, 5:36:10 PM10/10/10
to in-por...@googlegroups.com
Hi Phil,


You might need to create a separate new Virtual field for your Category Item (ie. Link) which will contain a list of all available categories (drop-down) and then will be updating PrimaryCat field on submission.

This is mostly PHP work as far as I can tell.


On update link page we NEVER allowed to change Primary category - only additional ones.

I hope this helps.


DA.
--


Best regards,

Dmitry A.

Phil -- wbtc.fr --

unread,
Oct 11, 2010, 2:31:31 AM10/11/10
to in-por...@googlegroups.com
Hi guys,

thank you for you answers, I'll deal with actual system for now.

P.

2010/10/10 Dmitry Andrejev <dand...@gmail.com>:

Alexander Obuhovich

unread,
May 27, 2011, 10:03:07 AM5/27/11
to in-por...@googlegroups.com
Actually you can allow user to choose primary category during link submissions process.

Simply add <inp2:m_RenderElement name="inp_edit_options" prefix="l" field="CategoryId" title="lu_title_ParentCategory"/> tag on link suggest form.

Also you can replace prefix="l" to prefix="n" to make it work for articles too.

This feature became available since In-Portal 5.0.0 release.

Phil -- wbtc.fr --

unread,
May 27, 2011, 10:08:39 AM5/27/11
to in-por...@googlegroups.com
ah :)

2011/5/27 Alexander Obuhovich <aik....@gmail.com>

Phil

unread,
Jun 23, 2011, 9:03:04 AM6/23/11
to In-Portal Development Team
I'm trying this function now on a v510, and the dropdown appears
blank, i.e. no parent category appears.

I've tested using a suggest link form in root category, as well as in
a subcategory, same result, and no error message en debug log.

What did I done wrong?


On 27 mai, 16:08, "Phil -- wbtc.fr --" <p...@wbtc.fr> wrote:
> ah :)
>
> 2011/5/27 Alexander Obuhovich <aik.b...@gmail.com>
>
>
>
> > Actually you can allow user to choose primary category during link
> > submissions process.
>
> > Simply add *<inp2:m_RenderElement name="inp_edit_options" prefix="l"
> > field="CategoryId" title="lu_title_ParentCategory"/>* tag on link suggest
> > form.
>
> > Also you can replace prefix="l" to prefix="n" to make it work for articles
> > too.
>
> > This feature became available since In-Portal 5.0.0 release.
>
> > On Mon, Oct 11, 2010 at 9:31 AM, Phil -- wbtc.fr -- <p...@wbtc.fr> wrote:
>
> >> Hi guys,
>
> >> thank you for you answers, I'll deal with actual system for now.
>
> >> P.
>
> >> 2010/10/10 Dmitry Andrejev <dandre...@gmail.com>:
> >> > Hi Phil,
>
> >> > You might need to create a separate new Virtual field for your Category
> >> Item
> >> > (ie. Link) which will contain a list of all available categories
> >> (drop-down)
> >> > and then will be updating PrimaryCat field on submission.
> >> > This is mostly PHP work as far as I can tell.
>
> >> > On update link page we NEVER allowed to change Primary category - only
> >> > additional ones.
> >> > I hope this helps.
>
> >> > DA.
>
> >> > On Sun, Oct 10, 2010 at 3:43 PM, Alexander Obuhovich <
> >> aik.b...@gmail.com>
> >> > wrote:
>
> >> >> There is no such "inp_pr_category_label" block in "advanced" theme.
>
> >> >> Primary category is category, passed to link suggestion template. So
> >> you
> >> >> need to pass that category in link used to open link suggestion form.
> >> That
> >> >> is usually done by "m_cat_id" parameter of "m_Link" tag or any tag,
> >> that
> >> >> produces link.
>
> >> >> On Sun, Oct 10, 2010 at 11:38 PM, Phil -- wbtc.fr -- <p...@wbtc.fr>

Alexander Obuhovich

unread,
Jun 23, 2011, 9:10:13 AM6/23/11
to in-por...@googlegroups.com
Maybe we disabled that ParentId field for Front-end, since it make additional sql to get that categories each time link is accessed (even on link detail page).

Phil -- wbtc.fr --

unread,
Jun 23, 2011, 3:00:31 PM6/23/11
to in-por...@googlegroups.com
Is there a way to activate it, in event handler maybe?

2011/6/23 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Jun 23, 2011, 4:21:18 PM6/23/11
to in-por...@googlegroups.com
Of course. Everything is possible via PHP class extending.

Phil -- wbtc.fr --

unread,
Jun 23, 2011, 4:43:17 PM6/23/11
to in-por...@googlegroups.com
ah :) is there a single bit to change somewhere for achieving this?

2011/6/23 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Jun 23, 2011, 4:45:44 PM6/23/11
to in-por...@googlegroups.com

And I even know where it is. Should I change it?

Phil -- wbtc.fr --

unread,
Jun 23, 2011, 5:09:21 PM6/23/11
to in-por...@googlegroups.com
it could be nice to post here in dev group, at least for me, and for all others who'd need it :)

2011/6/23 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Jun 26, 2011, 5:39:06 AM6/26/11
to in-por...@googlegroups.com
Method getStructureTreeAsOptions in CategoryHelper class, located in core/units/helpers/category_helper.php file:

Change from:

if ((defined('IS_INSTALL') && IS_INSTALL) || !$this->Application->isAdmin) {
// no need to create category structure during install
// OR on Front-End, because it's not used there
return Array ();
}

to:

if ((defined('IS_INSTALL') && IS_INSTALL)) {
// no need to create category structure during install
// OR on Front-End, because it's not used there
return Array ();
}

Part, marked with bold should be removed.


Of course you loose all changes after upgrade.

Phil -- wbtc.fr --

unread,
Jun 27, 2011, 6:00:53 AM6/27/11
to in-por...@googlegroups.com
Alex, thanks for this help, I'll give it a try !


2011/6/26 Alexander Obuhovich <aik....@gmail.com>

Phil

unread,
Jul 28, 2011, 4:39:08 AM7/28/11
to In-Portal Development Team
your mod works well, but unlike "MoreCategories", it list all
categories in catalog, instead of sub categories of actual category,
i.e. the category from where we load the page.

Any idea on this?

On Jun 27, 12:00 pm, "Phil -- wbtc.fr --" <p...@wbtc.fr> wrote:
> Alex, thanks for this help, I'll give it a try !
>
> 2011/6/26 Alexander Obuhovich <aik.b...@gmail.com>
>
>
>
> > Method getStructureTreeAsOptions in CategoryHelper class, located in
> > core/units/helpers/category_helper.php file:
>
> > Change from:
>
> > if ((defined('IS_INSTALL') && IS_INSTALL) *|| !$this->Application->isAdmin
> > *) {
> >  // no need to create category structure during install
> > // OR on Front-End, because it's not used there
> >  return Array ();
> > }
>
> > to:
>
> > if ((defined('IS_INSTALL') && IS_INSTALL)) {
> > // no need to create category structure during install
> >  // OR on Front-End, because it's not used there
> > return Array ();
> > }
>
> > Part, marked with bold should be removed.
>
> > Of course you loose all changes after upgrade.
>
> > On Fri, Jun 24, 2011 at 12:09 AM, Phil -- wbtc.fr -- <p...@wbtc.fr> wrote:
>
> >> it could be nice to post here in dev group, at least for me, and for all
> >> others who'd need it :)
>
> >> 2011/6/23 Alexander Obuhovich <aik.b...@gmail.com>
>
> >>> And I even know where it is. Should I change it?
> >>> On Jun 23, 2011 11:44 PM, "Phil -- wbtc.fr --" <p...@wbtc.fr> wrote:
> >>> > ah :) is there a single bit to change somewhere for achieving this?
>
> >>> > 2011/6/23 Alexander Obuhovich <aik.b...@gmail.com>
>
> >>> >> Of course. Everything is possible via PHP class extending.
>
> >>> >> On Thu, Jun 23, 2011 at 10:00 PM, Phil -- wbtc.fr -- <p...@wbtc.fr>
> >>> wrote:
>
> >>> >>> Is there a way to activate it, in event handler maybe?
>
> >>> >>> 2011/6/23 Alexander Obuhovich <aik.b...@gmail.com>
>
> >>> >>>> Maybe we disabled that ParentId field for Front-end, since it
> >>> >>>> make additional sql to get that categories each time link is
> >>> accessed (even
> >>> >>>> on link detail page).
>

Alexander Obuhovich

unread,
Jul 28, 2011, 4:47:45 AM7/28/11
to in-por...@googlegroups.com
This is exactly what it does. You can verify that "Parent Section" dropdown in admin on Link editing does exactly the same.

Phil -- wbtc.fr --

unread,
Jul 28, 2011, 5:23:26 AM7/28/11
to in-por...@googlegroups.com
ok, but is there a way to specify parent section from where to start listing? When I use "MoreCategories" element, the list starts from the place we are in url:

website/catalog/directory_1/suggest_link.html

will offer a list of all subdirs in "directory_1"

2011/7/28 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
Jul 28, 2011, 5:47:21 AM7/28/11
to in-por...@googlegroups.com
Nope. List of categories is the same no matter where you use it. It's not a tag, that can accept input parameters and filter a result, like MoreCategories does.

Phil -- wbtc.fr --

unread,
Jul 28, 2011, 5:57:53 AM7/28/11
to in-por...@googlegroups.com
hmmm. ok thanks !

2011/7/28 Alexander Obuhovich <aik....@gmail.com>
Reply all
Reply to author
Forward
0 new messages