[SOLVED] How to use 2 class with ELSE condition

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
Post Reply
User avatar
FanFanLaTuFlippe
Registered User
Posts: 157
Joined: Tue Mar 17, 2009 4:46 pm
Location: France
Name: Patrice
Contact:

[SOLVED] How to use 2 class with ELSE condition

Post by FanFanLaTuFlippe »

Hello,

I would like update my style WildWest to pbpbb 3.2.2 ans i would like use 2 class with "else" condition for align avatar on top right, and when login_out, center another image.

Because when image private message counter appears, it shifts the avatar.

I have try a lot of things but display "anonymous account" or not display avatar and account name , pm and notifications

Image

i've try this code, but doesn't work 100%.

Code: Select all

<ul class="<!-- IF S_REGISTERED_USER --> logg_in<!-- ELSE --> <!-- IF not PRIVATE_MESSAGE_COUNT and not NOTIFICATIONS_COUNT --> logg_in2<!-- ENDIF -->
This is my code.

Code: Select all

<!-- IF S_REGISTERED_USER -->
		<ul class="logg_in">
		<!-- EVENT navbar_header_user_profile_prepend -->
		<li id="username_logged_in" class="rightside2 <!-- IF CURRENT_USER_AVATAR --> no-bulletin<!-- ENDIF -->" data-skip-responsive="true">
			<!-- EVENT navbar_header_username_prepend -->
			<div class="header-profile dropdown-container">
				<a href="{U_PROFILE}" class="header-avatar"><!-- IF CURRENT_USER_AVATAR -->{CURRENT_USER_AVATAR} <!-- ENDIF --></a>
				<a href="{U_PROFILE}" class="header-avatar2 dropdown-trigger">{CURRENT_USERNAME_SIMPLE}</a>
				<div class="dropdown2" style="display: block margin-left: 1348px;">
					<div class="pointer2"><div class="pointer-inner2"></div></div>
					<ul class="dropdown2-contents" role="menu">
						<!-- IF U_RESTORE_PERMISSIONS -->
							<li>
								<a href="{U_RESTORE_PERMISSIONS}">
									<i class="icon fa-refresh fa-fw" aria-hidden="true"></i><span>{L_RESTORE_PERMISSIONS}</span>
								</a>
							</li>
						<!-- ENDIF -->

					<!-- EVENT navbar_header_profile_list_before -->

						<li>
							<a href="{U_PROFILE}" title="{L_PROFILE}" role="menuitem">
								<i class="icon fa-sliders fa-fw" aria-hidden="true"></i><span>{L_PROFILE}</span>
							</a>
						</li>
						<li>
							<a href="{U_USER_PROFILE}" title="{L_READ_PROFILE}" role="menuitem">
								<i class="icon fa-user fa-fw" aria-hidden="true"></i><span>{L_READ_PROFILE}</span>
							</a>
						</li>

						<!-- EVENT navbar_header_profile_list_after -->

						<li class="separator"></li>
						<li>
							<a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem">
								<i class="icon fa-power-off fa-fw" aria-hidden="true"></i><span>{L_LOGIN_LOGOUT}</span>
							</a>
						</li>
					</ul>
				</div>
			</div>
			<!-- EVENT navbar_header_username_append -->
		</li>
		<!-- IF S_DISPLAY_PM -->
			<li class="rightside2" data-skip-responsive="true">
				<a href="{U_PRIVATEMSGS}" role="menuitem">
					<i class="icon fa-inbox fa-fw" aria-hidden="true"></i><span>{L_PRIVATE_MESSAGES} </span><strong class="badge<!-- IF not PRIVATE_MESSAGE_COUNT --> hidden<!-- ENDIF -->">{PRIVATE_MESSAGE_COUNT}</strong>
				</a>
			</li>
		<!-- ENDIF -->
		<!-- IF S_NOTIFICATIONS_DISPLAY -->
			<li class="dropdown-container dropdown-{S_CONTENT_FLOW_END} rightside2" data-skip-responsive="true">
				<a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button" class="dropdown-trigger">
					<i class="icon fa-bell fa-fw" aria-hidden="true"></i><span>{L_NOTIFICATIONS} </span><strong class="badge<!-- IF not NOTIFICATIONS_COUNT --> hidden<!-- ENDIF -->">{NOTIFICATIONS_COUNT}</strong>
				</a>
				<!-- INCLUDE notification_dropdown.html -->
			</li>
		<!-- ENDIF -->
		<!-- EVENT navbar_header_user_profile_append -->
	<!-- ELSE --><!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
		<div class="login_out">
		<li class="rightside2 rightsidetop" lo data-skip-responsive="true">
			<a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem">
				<i class="icon fa-power-off fa-fw" aria-hidden="true"></i><span>{L_LOGIN_LOGOUT}</span>
			</a>
		</li>
		
		<!-- IF S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) -->
			<li class="rightside2" data-skip-responsive="true">
				<a href="{U_REGISTER}" role="menuitem">
					<i class="icon fa-pencil-square-o  fa-fw" aria-hidden="true"></i><span>{L_REGISTER}</span>
				</a>
			</li>
		</div>
		<!-- ENDIF -->
		<!-- ENDIF -->
		<!-- EVENT navbar_header_logged_out_content -->
	<!-- ENDIF -->
	
	</ul>
If someone can help me, please.

thank's so much and have a great day :)
Last edited by FanFanLaTuFlippe on Mon Mar 12, 2018 9:29 pm, edited 2 times in total.
My Contributions | Styles Design phpBB | Demo Styles
-------------------------------------------------------------------------------------------------------------------------------------
The earth does everything without rushing, yet, everything is done
From the enlightened awareness of the future that we draw, the peace of our present is built.
User avatar
Hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 1065
Joined: Wed Dec 30, 2009 8:14 am
Name: Michael Miday
Contact:

Re: How to use 2 class with ELSE condition

Post by Hanakin »

You have two ifs and only one end if. You probably want an else if. Like so using twig {% if xxx %} xxx {% elseif xxxx %} xxxx {% endif %}
User avatar
FanFanLaTuFlippe
Registered User
Posts: 157
Joined: Tue Mar 17, 2009 4:46 pm
Location: France
Name: Patrice
Contact:

Re: How to use 2 class with ELSE condition

Post by FanFanLaTuFlippe »

Hanakin wrote: Mon Mar 12, 2018 4:28 pm You have two ifs and only one end if. You probably want an else if. Like so using twig

Code: Select all

{% if xxx %} xxx {% elseif xxxx %} xxxx {% endif %}
Hello, Thank you for your answer but, this one doesn't work.

EDIT: i found the solution ;)

Thank you so much ;)
My Contributions | Styles Design phpBB | Demo Styles
-------------------------------------------------------------------------------------------------------------------------------------
The earth does everything without rushing, yet, everything is done
From the enlightened awareness of the future that we draw, the peace of our present is built.
User avatar
Mannix_
Registered User
Posts: 1834
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt
Contact:

Re: How to use 2 class with ELSE condition

Post by Mannix_ »

FanFanLaTuFlippe wrote: Mon Mar 12, 2018 7:03 pm
Hanakin wrote: Mon Mar 12, 2018 4:28 pm You have two ifs and only one end if. You probably want an else if. Like so using twig

Code: Select all

{% if xxx %} xxx {% elseif xxxx %} xxxx {% endif %}
Hello, Thank you for your answer but, this one doesn't work.

EDIT: i found the solution ;)

Thank you so much ;)
Could so be so kind and share with us with the fix :)
Did I helped You? Consider a donation.
New version of phpBB has been released? My styles aren't validated for it yet? Check my page for the latest downloads!
User avatar
FanFanLaTuFlippe
Registered User
Posts: 157
Joined: Tue Mar 17, 2009 4:46 pm
Location: France
Name: Patrice
Contact:

Re: [SOLVED] How to use 2 class with ELSE condition

Post by FanFanLaTuFlippe »

Hello Mannix_ ;)

Sure, i think the problem came of condition " <!-- if not NOTIFICATIONS_COUNT --> " that seems to me does not work.

so this one work perfectly

Code: Select all

<ul class="<!-- IF S_REGISTERED_USER and not PRIVATE_MESSAGE_COUNT --> logg_in<!-- ELSEIF PRIVATE_MESSAGE_COUNT --> logg_in2<!-- ENDIF -->">
Hava a great day ;)
My Contributions | Styles Design phpBB | Demo Styles
-------------------------------------------------------------------------------------------------------------------------------------
The earth does everything without rushing, yet, everything is done
From the enlightened awareness of the future that we draw, the peace of our present is built.
Post Reply

Return to “[3.2.x] Styles Support & Discussion”