Forum categories

Плагин Userfields - дополнительные поля пользователя без создания экстраполей

Плагин для CMS Cotonti позволяет создавать и управлять дополнительными пользовательскими полями (например, номер телефона, название компании, адрес) без изменения таблицы cot_users. Использует собственные таблицы

webitproff
webitproff • 2025-09-10 07:03 #363

Теперь, по индивидуальной кастомизации, вот пример полей в шаблоне users.details.tpl

<!-- IF {PHP|cot_plugin_active('userfields')} -->						
<div class="row mb-3">
	<div class="list-group list-group-striped list-group-flush mb-4">
		<!-- IF {USERFIELDS_COMPANY_NAME} -->
		<li class="list-group-item list-group-item-action ">
			<div class="row g-3">
				<div class="col-12 col-lg-4">
					<h5 class="mb-0 fs-6 text-secondary fw-semibold">
						{USERFIELDS_COMPANY_NAME_TITLE}
					</h5>
				</div>
				<div class="col-12 col-lg-8">
					<div>
						<p><i class="fa-solid fa-building me-2"></i>{USERFIELDS_COMPANY_NAME}</p>
					</div>
				</div>
			</div>
		</li>
		<!-- ENDIF -->
		<!-- IF {USERFIELDS_PROMO_TEXT} -->
		<li class="list-group-item list-group-item-action ">
			<div class="row g-3">
				<div class="col-12 col-lg-4">
					<h5 class="mb-0 fs-6 text-secondary fw-semibold">
						{USERFIELDS_PROMO_TEXT_TITLE}
					</h5>
				</div>
				<div class="col-12 col-lg-8">
					<div>
						<p><i class="fa-solid fa-list-check fa-lg me-2"></i>{USERFIELDS_PROMO_TEXT}</p>
					</div>
				</div>
			</div>
		</li>
		<!-- ENDIF -->
		<!-- IF {USERFIELDS_GITHUB} -->
		<li class="list-group-item list-group-item-action ">
			<div class="row g-3">
				<div class="col-12 col-lg-4">
					<h5 class="mb-0 fs-6 text-secondary fw-semibold">
						{USERFIELDS_GITHUB_TITLE}
					</h5>
				</div>
				<div class="col-12 col-lg-8">
					<div>
						<a rel="noopener noreferrer" href="https://github.com/{USERFIELDS_GITHUB}" target="_blank" class="fw-semibold">
							<i class="fa-brands fa-square-github fa-xl me-2"></i>{PHP.L.userfields_github_details}
						</a>
					</div>
				</div>
			</div>
		</li>
		<!-- ENDIF -->
		<!-- IF {USERFIELDS_TELEGRAM} -->
		<li class="list-group-item list-group-item-action ">
			<div class="row g-3">
				<div class="col-12 col-lg-4">
					<h5 class="mb-0 fs-6 text-secondary fw-semibold">
						{USERFIELDS_TELEGRAM_TITLE}
					</h5>
				</div>
				<div class="col-12 col-lg-8">
					<div>
						<a rel="noopener noreferrer" href="https://t.me/{USERFIELDS_TELEGRAM}" target="_blank" class="fw-semibold">
							<i class="fa-brands fa-telegram fa-xl me-2"></i>{PHP.L.userfields_telegram_details}
						</a>
					</div>
				</div>
			</div>
		</li>
		<!-- ENDIF -->
		<!-- IF {USERFIELDS_CELL_NUMBER} -->
		<li class="list-group-item list-group-item-action ">
			<div class="row g-3">
				<div class="col-12 col-lg-4">
					<h5 class="mb-0 fs-6 text-secondary fw-semibold">
						{USERFIELDS_CELL_NUMBER_TITLE}
					</h5>
				</div>
				<div class="col-12 col-lg-8">
					<div>
						<a rel="noopener noreferrer" href="tel:{USERFIELDS_CELL_NUMBER}" class="fw-semibold">
							<i class="fa-solid fa-phone-volume fa-xl me-2"></i>{USERFIELDS_CELL_NUMBER}
						</a>
					</div>
				</div>
			</div>
		</li>
		<!-- ENDIF -->
	</div>
</div>
<!-- ENDIF -->

как видите, каждое поле вы контролируете и по оформлению и по значениям, которые отображаются. наглядно можно увидеть в моем профиле.

 

 

 

🗿

🧙‍♂️ Well met, good traveler! Fate has guided your steps to our humble realm. Here, wise sages and masters of the coding craft ⚒️📜 gather to unravel the mysteries of the code ✨⚙️, share their knowledge, and add new chapters to our chronicles.
⬅️ To the left lie ancient scrolls 📚 filled with forgotten wisdom. ⬆️ Straight ahead, friendly folk offer counsel 💬 to those in need. ➡️ To the right, you may become a chronicler ✍️ yourself, sharing your craft and leaving words of wisdom for those yet to come.
📝 Delay no longer—tell us the name by which you are known, complete the rite of registration 🛡️, and join our fellowship!
🏰 Our brotherhood holds no secret initiation, yet many halls remain closed to wandering guests, for some knowledge 💎 is reserved for those who choose to walk this path beside us.