baijunyao / laravel-bjyblog

Laravel v9 blog
https://baijunyao.com/docs/laravel-bjyblog
MIT License
525 stars 201 forks source link

Question about navigation #132

Open yuri25 opened 4 years ago

yuri25 commented 4 years ago

What is the point of using the target = "_ blank" attribute when opening an article or comment? Maybe it makes sense to make an opening in the current browser tab? If a user views articles and comments, many tabs open. I have commented out this attribute in the file so far: /resources/views/home/index/index.blade.php Line 30: <a class="b-oa-title" href="{{ $v-> url}} "> <! - target =" _ blank "-> {{$ v-> title}} </a> Line 75: <a class=" b-readall" href="{{ $v-> url}} "> <! - target =" _ blank "-> {{__ ('Read More')}} </a> And in the file: /resources/views/layouts/home.blade.php Line 131: <a class="b-recommend-a" href="{{ $v-> url}} "> <! - target =" _ blank "-> <span class =" fa fa-th-list b- black "> </span> {{$ v-> title}} </a> Line 145: {{ __('Comment') }}<a href="{{ $comment->article->url }}#comment-{{ $comment->id }}"> <!--target="_blank"--> → {{ $comment->article->sub_title }}</a>

This element on line 145 → improves the display of comments in the sidebar block. By the way, if it is possible in this block letters in words are also cut off, it would be nice to increase the number of words there and cut off words

Only now when updating these changes will be overwritten ... and you will have to manually make the changes again. What do you think? It may make sense to remove this attribute so as not to produce many tabs or make this parameter customizable in the admin panel. It would be great to introduce breadcrumbs into the blog .... https://dev.to/jordanirabor/building-dynamic-breadcrumbs-in-laravel-926 Or this: https://github.com/davejamesmiller/laravel-breadcrumbs  But probably it is very difficult. But perhaps you find it necessary to simply remove the target = "_ blank" attribute from the files that I wrote. Your opinion? Thank you very much for your work!

baijunyao commented 4 years ago

OK, I will add a config to allow custom target values.
And I will check all the word truncation issues.
For breadcrumbs, I don't know where to put it on the page? Functionally it can be easily added, but it won't be beautiful.
Thank you.

yuri25 commented 4 years ago

Dear Junyao Bai! Thank you for your loyalty and responsiveness. Where to place the breadcrumbs is possible as in the screenshot ... Although now I'm not sure that this is necessary at all :)) Perhaps you are right that it will not look very beautiful. Perhaps this also makes sense to make a custom item in the admin panel. This is at your discretion. If this is really ugly, then probably it’s not worth doing. And about other problems - thank you very much for your work!

inst-1

baijunyao commented 4 years ago

OK, I try to do this.

baijunyao commented 4 years ago

Now, you can custom link target, please pull the latest code and upgrade. image If the translation is inaccurate, please open a PR. https://github.com/baijunyao/laravel-bjyblog/blob/d764df50d326ef26ff19188b453003589f622612/resources/lang/ru.json#L187-L189

yuri25 commented 4 years ago

Updated, everything works fine. A translation would be preferable: "Link Target": "Открывать ссылки", "New Tab": "В новой вкладке", "Current Tab": "В текущей вкладке", Thank you!

baijunyao commented 4 years ago

Which of the following do you like? Option 2 feels better?

image

image

yuri25 commented 4 years ago

Yes, the second option is better.

baijunyao commented 4 years ago

Now, breadcrumb is completed.
image

yuri25 commented 4 years ago

Thank you so much! Please correct the translation as follows: хлебный мякиш Instead, the correct menu item in the admin panel would be: Отображать строку навигации (breadcrumbs) Thank you so much for the job well done!

baijunyao commented 4 years ago

The translation has been updated.

yuri25 commented 4 years ago

Thank you very much!