掲示板

Default ADT for Breadcrumbs

7年前 に Zack Brown によって更新されました。

Default ADT for Breadcrumbs

New Member 投稿: 3 参加年月日: 16/08/03 最新の投稿
I'm new to Liferay and am currently trying to migrate an existing 6.2 project to 7.0-GA2. I'd managed to migrate most of the custom theme, but the Breadcrumbs Portlet didn't seem to be working - it was just a blank Portlet with editable text initialized as "Breadcrumb". I originally thought something was wrong with my Velocity template:

<nav id="breadcrumbs">
  #breadcrumbs()
</nav>

but then I decided to see if I could even get it working in the default theme. Adding the Portlet to a page with the default Liferay theme turns up the same thing - no actual breadcrumbs, just "Breadcrumb".

This can be remedied by adding an ADT to the Portlet with something like this:

&lt;#if entries?has_content&gt;
	&lt;#list entries as curEntry&gt;
		<a href="${curEntry.getURL()}">${curEntry.getTitle()}</a>
		&lt;#sep&gt;&gt;&nbsp;<!--#sep-->
	<!--#list-->
<!--#if-->

but I'm wondering why there isn't a default template for Breadcrumbs. Is there something simple I'm missing?

Thanks!
thumbnail
7年前 に Julio Camarero によって更新されました。

RE: Default ADT for Breadcrumbs

Liferay Legend 投稿: 1668 参加年月日: 08/07/15 最新の投稿
Hi Zack,

if you start with a clean 7.0 database you will have several ADTs created for Breadcrumb, and one of them is the default.

I think something must be failing in the migration and some ADTs are not being installed. You should be able to export those ADTs from another installation or even another portal instance and then import them in this one.

Let us know if this doesn't work.

Thank you!
7年前 に Zack Brown によって更新されました。

RE: Default ADT for Breadcrumbs

New Member 投稿: 3 参加年月日: 16/08/03 最新の投稿
I found the issue - tl;dr the MySQL database needed to be created using the UTF-8 character set.

The project I'm migrating is a bootstrapping project in the form of a vagrant box. Your post caused me to look a little more into exactly how it was being created, removing one thing after another until I found the seemingly innocent puppet command
command =&gt; "mysql -uroot -p${password} -e \"create database ${l_db};grant all on ${l_db}.* to ${l_user}@'localhost' identified by '${l_pass}'; flush privileges;\""


I tried not using vagrant, instead running directly on my machine and creating the database using a simpler command I was steered toward from here
create database lportal character set utf8;

and everything worked great.

So I modified the original puppet command to
command =&gt; "mysql -uroot -p${password} -e \"create database ${l_db} character set utf8;grant all on ${l_db}.* to ${l_user}@'localhost' identified by '${l_pass}'; flush privileges;\""

and sure enough, the templates were there. In fact, I was missing a bunch of other ones as well (including a couple default themes), so this was a welcome fix.

Thanks for pointing me in the right direction!