Request: Mandatory Author's category

Post Reply
User avatar
SadlyMistaken
Jr. Bludit
Posts: 2
Joined: Mon Aug 26, 2019 8:49 pm

Hello everybody!!

My authors (users that only want to focus on write write write....) are lazy. They don't want to choose a category, they only want to write and "maybe" to choose tags... :D :D :D

nahh... that is a joke... :lol: they always choose a category hahaha

I would like to have an url as categories url... but named with the alias name of the author for example, and then to list the short link cards of their articles.. o maybe i want something like:
http://www.mywebsite.dot/author/author_name/ and then, magic!

The only way i can imagine and manage to do this in that moment is:
- I created a category with the name of the author...
- I created a navigator link in my sidebar with the categories urls...
- I asked to every author to choose their respective category in their articles...

so... my authors are Categories... Anne..is able to see her links cards in mysite.com/category/anne
:? But her articles haven't own category... "Recipes" "Technician" etc...so... TAGS... ( :? )

BUT! maybe it would be easier if in the users table, the administrator could see 2 things.
- A sticky square with label "Mandatory Category" (YES/NO... boolean...whatever)
- A input text to write THAT new category or.. a dropdown to choose the category (better option in my opinion)

and the result of this could be that they would see an inactive dropdown in the category section when they are writting their content.. because It would be the correct one, always... and then only write tags... I don't know..

but... i rather prefer the MAGIC option, muchly

:P hahahaha... Ok, what do you think? tell me please, if that is an absurd idea don't hesitate to tell me too....

Thanks!!! (And apologize my bad english... sorry... i only want to be read for more people in the forum :D) Bye!
Image Fascinado con Bludit :o
User avatar
SadlyMistaken
Jr. Bludit
Posts: 2
Joined: Mon Aug 26, 2019 8:49 pm

Sorry I just read that abs301216 asked for the same in 2019/May post:
viewtopic.php?f=6&t=1471

:D
Image Fascinado con Bludit :o
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

You can use the following to get the username, nickname etc.:

$page->username()

and

$page->user('username')
$page->user('nickname')
$page->user('firstName')
$page->user('lastName')

Together with if conditions in the template home.php you can create author pages for example.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
shoovi
Jr. Bludit
Posts: 4
Joined: Fri Aug 28, 2020 9:26 am

Hi, I am working on some customization of the page's theme and I can not get the first name of the logged user.

So if I am a logged user I'd like to see my "firstName" displayed on the screen.
I tried this $login->user('firstName'); but it does not work.


How to get the FirstName of the logged user?
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Diego, the developer, answered me, that you have to to create the $login in the frontend to get the username of the logged in user:

Code: Select all

$login = new Login();
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
shoovi
Jr. Bludit
Posts: 4
Joined: Fri Aug 28, 2020 9:26 am

Thanks, Edi,
Yes, I do it. I create a new $login object and then I try this: $login->user('firstName');
but I get nothing.

;(
shoovi
Jr. Bludit
Posts: 4
Joined: Fri Aug 28, 2020 9:26 am

So my point is that I want to get the logged user first name, not a user name.

The first name is the field that can be optionally filled in the Admin panel, and I need to be able to access that value while I am logged in.
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

You can post feature requests on our GitHub tracker:

https://github.com/bludit/bludit/issues
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
shoovi
Jr. Bludit
Posts: 4
Joined: Fri Aug 28, 2020 9:26 am

Ok, I've made it!

Code: Select all

	$login = new Login();
	$myLoggedUser = $login->username();
	
		$myLoggedUserObject = new User($myLoggedUser);
		$myLoggedUserFirstName = $myLoggedUserObject->firstName($myLoggedUser);
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Great!
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply