Jump to content

Display "Add new Entry" box with blog listing on entry page


Maulik

Recommended Posts

  • 3 months later...
Posted

Hello,

Edit the template blog - front - view - view.

Code that you need

		{{$blogs = \IPS\blog\Blog::loadByOwner( \IPS\Member::loggedIn(), array( array( 'blog_disabled=?', 0 ) ) );}}
		{{if count( $blogs )}}
			<li class='ipsToolList_primaryAction'>
				{{if count( $blogs ) > 1}}
					<a class="ipsButton ipsButton_medium ipsButton_important ipsButton_fullWidth" href="#elCreateEntry_menu" data-ipsMenu id='elCreateEntry'>
						{lang="add_entry"} &nbsp;<i class='fa fa-caret-down'></i>
					</a>
					<ul class='ipsMenu ipsMenu_normal ipsHide' id='elCreateEntry_menu'>
						<li class='ipsMenu_title'>{lang="add_entry_to"}</li>
						{{foreach $blogs as $blog}}
							{{if $blog->disabled != 1}}
								<li class='ipsMenu_item'>
									<a href='{url="app=blog&module=blogs&controller=submit&id={$blog->id}" seoTemplate="blog_submit"}' class='ipsTruncate ipsTruncate_line'>{$blog->_title}</a>
								</li>
							{{endif}}
						{{endforeach}}
					</ul>
				{{else}}
					{{foreach $blogs as $blog}}
						{{if $blog->disabled != 1}}
							<a class="ipsButton ipsButton_medium ipsButton_important ipsButton_fullWidth" href="{url="app=blog&module=blogs&controller=submit&id={$blog->id}" seoTemplate="blog_submit"}">
								{lang="add_entry"}
							</a>
						{{endif}}
					{{endforeach}}
				{{endif}}
			</li>
        {{endif}}

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...