How to show button instead of whole link inside content 2.X

 
Посетитель
small user social cms
Сообщений: 5
Hello brothers and greetings from Serbia smile I just started using InstantCMS and so far I like it very much because you have full control over content and there is soo much options which is great, just love it love

I created content type and added Link field type and my question is how to show button inside content instead of the whole link, example:

(Dont want this) Link: https://instantcms.ru

(I want to show it as button with my own title, like this) Link: Go to this link

Hope someone understand me, I can read Russian but dont understand every word so documentation is not much useful for me sad

I did try to find solution inside your docs but without any luck. I understand HTML and CSS, but dont know which file to edit so I can accomplish this scratch
Посетитель
small user social cms
МедальАвторитет форумаПочетный донор проектаПочетный донор проектаПочетный донор проекта
Сообщений: 2397
How to show button instead of whole link inside content
Недорогие VPS с бесплатным администрированием!
Удобный и гибкий автопостинг в соцсети
Реклама
cms
Посетитель
small user social cms
Сообщений: 5
Thanks for your help AndroS smile , I know about that option but need to add title to link button automatically smile

See I marked that field validation as Required and as URL so when I click Save then I am getting error because its not valid url (Example: http://google.com|Google).

I am sure that I need to edit some file and add code to it but not sure which one.

Would be nice to add input field where we could add custom title for our link. For example:

Link CSS class: button
Custom link title: Go to this page or whatever we want to enter
Посетитель
small user social cms
МедальАвторитет форумаКубок зрительских симпатийПочетный донор проекта
Сообщений: 2939
@Alex85:
I am sure that I need to edit some file and add code to it but not sure which one.
Постоји могућност додавања css класе. Можете додати слику са позадинским дугметом за ову ставку менија.
Посетитель
small user social cms
Сообщений: 5
Hvala Ris zst , pronašao sam rešenje smile

Well I found solution, under system/fields/url.php line 79:

Код PHP:
  1. return '<a rel="noopener'.$nofollow.'" target="_blank" '.$class.' href="'.htmlspecialchars($href).'">'.htmlspecialchars($value).'</a>';
Just edit like this:

Код PHP:
  1. return '<a rel="noopener'.$nofollow.'" target="_blank" '.$class.' href="'.htmlspecialchars($href).'">'.htmlspecialchars("Go to this link or whatever you want to put in here").'</a>';
Thanks much for your help guys dance
Посетитель
small user social cms
Сообщений: 5
One more question zst

How to manually add content type custom field?

I see they are auto loaded (default_item.tpl.php) but because of the design I want and I need to add them manually hoho
Посетитель
small user social cms
МедальАвторитет форумаКубок зрительских симпатийПочетный донор проекта
Сообщений: 2939
Спойлер
InstantCMS Team
small user social cms
МедальАвторитет форумаКубок зрительских симпатий
Сообщений: 4574
Documentation in English
Видео каталог для InstantCMS | Аудио каталог для InstantCMS | Мы Вконтакте | Предложение для спонсоров
Посетитель
small user social cms
Сообщений: 5
Ok, I found solution for this. I know how to add fields smile

If you want to put your field where you want then you can do it like this:

Код PHP:
  1. <?php echo $fields['link']['html']; ?>
In my case I have field called link and you should use name that you set inside system name smile

Or you can use it like this without html and set your own design:

Код PHP:
  1. <?php echo $item['link']; ?>
Hope this is the right way because its working fine for me popcorn
В начало страницы
Предыдущая темаСледующая тема Перейти на форум:
Быстрый ответ
Чтобы писать на форуме, зарегистрируйтесь или авторизуйтесь.