Page 1 of 1

CGblog How to force a specific category on fesubmit?

Posted: Sun Apr 20, 2014 4:47 am
by netplan
I am trying to let FEU post to CGBlog in a specific category

with the tag {CGBlog action="fesubmit" category="news"}

According to help, it should show only the category "news" but all categories are shown?

Also in the current default fesubmit template, if i choose any category that is not committed to database, the blog entry then has no category at all...

How do i force a specific category when using fesubmit ?

Regards Thomas

cmsms 1.11.10
FEU 1.23.2
CGBlog 1.12.1

Re: CGblog How to force a specific category on fesubmit?

Posted: Sun Apr 20, 2014 5:18 pm
by Dr.CSS
Have you tried setting the General Blog Options > Default Category:..?

Re: CGblog How to force a specific category on fesubmit?

Posted: Mon Apr 21, 2014 6:30 am
by netplan
yes, but no category are set in database at all using the default fesubmit form
/Thomas.

Re: CGblog How to force a specific category on fesubmit?

Posted: Mon Apr 21, 2014 4:02 pm
by calguy1000
CGBlog has no method to 'force' a specific category in the fesubmit form.

It has a few methods to specify 'default categories'. Though it looks like the method to specify the default category on the tag may have been broken in the last version. Not sure yet though as I have not tested.

If you want to FORCE a category you will have to modify your fesubmit template and replace the category inputs with a hidden field of the same name.

Re: CGblog How to force a specific category on fesubmit?

Posted: Tue Apr 22, 2014 5:34 pm
by netplan
okay any hints on how to do that ? - i dont understand how to replace the loop showing the full category tree.

This code part in fesubmit template

Code: Select all

{if isset($category_tree)}
	<div class="row">
	        {function do_category_tree depth=0}
                  {foreach $category_tree as $node}
                    {repeat string='&nbsp;&nbsp; ' times=$depth} <label><input type="checkbox" name="{$thename}" value="{$node.id}"> {$node.name}</label><br/>
                    {if isset($node.children)}{do_category_tree category_tree=$node.children depth=$depth+1}{/if}
                  {/foreach}
		{/function}
		<p class="col-md-4 text-right">{$categorytext}:</p>
		<p class="col-md-8" style="max-height: 8em; overflow-y: auto;">
		  {$thename=$actionid|cat:'cgblog_category_id'}
		  {do_category_tree}
                </p>
	</div>
	{/if}
should be replaced with something like

Code: Select all

<input type="hidden" name="{$actionid}cgblog_category_id" value="1"/> {* Force category 1 *}
but that does not Work.. How do i set current blog_id and my choosen category_id in cms_module_cgblog_blog_categories table in database ?

/Thomas